This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Getopt-Long to CPAN version 2.47
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 22 Jun 2015 12:06:17 +0000 (13:06 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 22 Jun 2015 13:16:01 +0000 (14:16 +0100)
  [DELTA]

Changes in version 2.47
-----------------------

* Fix bug https://rt.cpan.org/Ticket/Display.html?id=89513.

  Should have done that earlier :)

  This changes the format for accepted float numbers:

  <optional sign>
  <optional mantissa>
  <optional dec.point and fraction>
  <optional "e" and exponent>

  Mantissa and decimal fraction may not both be omitted.

  Underscores are permissible virtually anywhere in numbers for clarity.

Porting/Maintainers.pl
cpan/Getopt-Long/lib/Getopt/Long.pm

index 6f16b84..46db515 100755 (executable)
@@ -600,7 +600,7 @@ use File::Glob qw(:case);
     },
 
     'Getopt::Long' => {
-        'DISTRIBUTION' => 'JV/Getopt-Long-2.46.tar.gz',
+        'DISTRIBUTION' => 'JV/Getopt-Long-2.47.tar.gz',
         'FILES'        => q[cpan/Getopt-Long],
         'EXCLUDED'     => [
             qr{^examples/},
index 06fa33a..cce60f5 100644 (file)
@@ -4,8 +4,8 @@
 # Author          : Johan Vromans
 # Created On      : Tue Sep 11 15:00:12 1990
 # Last Modified By: Johan Vromans
-# Last Modified On: Tue Jun  2 10:40:52 2015
-# Update Count    : 1685
+# Last Modified On: Tue Jun 16 15:28:03 2015
+# Update Count    : 1695
 # Status          : Released
 
 ################ Module Preamble ################
@@ -17,10 +17,10 @@ use 5.004;
 use strict;
 
 use vars qw($VERSION);
-$VERSION        =  2.46;
+$VERSION        =  2.47;
 # For testing versions only.
 use vars qw($VERSION_STRING);
-$VERSION_STRING = "2.46";
+$VERSION_STRING = "2.47";
 
 use Exporter;
 use vars qw(@ISA @EXPORT @EXPORT_OK);
@@ -255,7 +255,12 @@ use constant PAT_XINT  =>
   "|".
          "0[0-7_]*".
   ")";
-use constant PAT_FLOAT => "[-+]?[0-9_]+(\.[0-9_]+)?([eE][-+]?[0-9_]+)?";
+use constant PAT_FLOAT =>
+  "[-+]?".                     # optional sign
+  "(?=[0-9.])".                        # must start with digit or dec.point
+  "[0-9_]*".                   # digits before the dec.point
+  "(\.[0-9_]+)?".              # optional fraction
+  "([eE][-+]?[0-9_]+)?";       # optional exponent
 
 sub GetOptions(@) {
     # Shift in default array.
@@ -1227,8 +1232,6 @@ sub FindOption ($$$$$) {
     }
 
     elsif ( $type eq 'f' ) { # real number, int is also ok
-       # We require at least one digit before a point or 'e',
-       # and at least one digit following the point and 'e'.
        my $o_valid = PAT_FLOAT;
        if ( $bundling && defined $rest &&
             $rest =~ /^($key_valid)($o_valid)(.*)$/s ) {
@@ -1298,9 +1301,6 @@ sub ValidValue ($$$$$) {
     }
 
     elsif ( $type eq 'f' ) { # real number, int is also ok
-       # We require at least one digit before a point or 'e',
-       # and at least one digit following the point and 'e'.
-       # [-]NN[.NN][eNN]
        my $o_valid = PAT_FLOAT;
        return $arg =~ /^$o_valid$/;
     }