Bill Allombert on Wed, 01 Feb 2012 17:49:26 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: tex2mail and perl5.14


On Sat, Jan 28, 2012 at 04:45:14PM +0100, Bill Allombert wrote:
> Hello PARI developers,
> 
> tex2mail generates a warning with perl5.14 (Debian sid version):
> 
> $ perl misc/tex2mail
> Legacy library newgetopt.pl will be removed from the Perl core distribution
> in the next major release. Please install the separate libperl4-corelibs-perl
> package. It is being used at (eval 1), line 1.
> 
> Maybe we should port it to perl5.

I offer the following patch, which replace newgetopt by Getopt::Long.

Cheers,
Bill.
>From 7345f4ea15c6f625480f027bfdef14cba8a81588 Mon Sep 17 00:00:00 2001
From: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
Date: Wed, 1 Feb 2012 17:39:47 +0100
Subject: [PATCH] Replace newgetopt.pl by Getopt::Long

---
 misc/tex2mail.in |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/misc/tex2mail.in b/misc/tex2mail.in
index 08a0380..0827956 100755
--- a/misc/tex2mail.in
+++ b/misc/tex2mail.in
@@ -21,9 +21,17 @@
 #	ignorefonts		# make math fonts (\mathfrak etc) into NOPs
 #	scissors		# Symbol to emit when a long line is cut
 
-eval 'require "newgetopt.pl";
-  &NGetOpt("linelength=i","maxdef=i","debug=i","by_par", "TeX",
-	   "ragged", "noindent", "ignorefonts", "scissors=s", "noflush")'
+use Getopt::Long;
+  &GetOptions("linelength=i" => \$opt_linelength,
+              "maxdef=i" => \$opt_maxdef,
+              "debug=i" => \$opt_debug,
+              "by_par" => \$opt_by_par, 
+              "TeX" => \$opt_TeX,
+	      "ragged" => \$opt_ragged, 
+              "noindent" => \$opt_noindent, 
+              "ignorefonts" => \$opt_ignorefonts, 
+              "scissors=s" => \$opt_scissors, 
+              "noflush" => \$opt_noflush)
     || warn "Errors during parsing command line options" .
 	($@ ? ": $@" : '') . ".\n";
 $linelength= $opt_linelength || 75;
-- 
1.7.2.5