This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Report a better error when trying to use negative version numbers instead of 'Invalid...
authorClaes Jakobsson <claes@versed.se>
Thu, 30 Jun 2011 20:09:13 +0000 (22:09 +0200)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 1 Jul 2011 02:27:37 +0000 (19:27 -0700)
pod/perlmodlib.PL
util.c

index a82f22f..26f69cb 100644 (file)
@@ -1328,7 +1328,7 @@ Give the module a version/issue/release number.
 
 To be fully compatible with the Exporter and MakeMaker modules you
 should store your module's version number in a non-my package
-variable called $VERSION.  This should be a floating point
+variable called $VERSION.  This should be a positive floating point
 number with at least two digits after the decimal (i.e., hundredths,
 e.g, C<$VERSION = "0.01">).  Don't use a "1.3.2" style version.
 See L<Exporter> for details.
diff --git a/util.c b/util.c
index 318c965..093b70e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -4494,6 +4494,9 @@ dotted_decimal_version:
            /* found just an integer */
            goto version_prescan_finish;
        }
+       else if ( *d == '-') {
+               BADVERSION(s,errstr,"Invalid version format (negative version number)");                
+       }
        else if ( d == s ) {
            /* didn't find either integer or period */
            BADVERSION(s,errstr,"Invalid version format (non-numeric data)");