diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2015-06-22 13:06:17 +0100 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2015-06-22 14:16:01 +0100 |
commit | 083087afa9f0243f193012e4766c2abe05218c47 (patch) | |
tree | b72ff3f65d9cbaf960cf49af69c818646f6f34f4 /cpan/Getopt-Long | |
parent | d9fc04eebe29b8cf5f6f6bf31373b202eafa44d6 (diff) | |
download | perl-083087afa9f0243f193012e4766c2abe05218c47.tar.gz |
Update Getopt-Long to CPAN version 2.47
[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.
Diffstat (limited to 'cpan/Getopt-Long')
-rw-r--r-- | cpan/Getopt-Long/lib/Getopt/Long.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm index 06fa33a6ce..cce60f5285 100644 --- a/cpan/Getopt-Long/lib/Getopt/Long.pm +++ b/cpan/Getopt-Long/lib/Getopt/Long.pm @@ -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$/; } |