This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fwd: CPAN Upload: J/JP/JPEACOCK/version-0.70.tar.gz
[perl5.git] / util.c
diff --git a/util.c b/util.c
index a8b83f7..d23dc8a 100644 (file)
--- a/util.c
+++ b/util.c
@@ -4141,6 +4141,9 @@ Perl_scan_version(pTHX_ const char *s, SV *rv, bool qv)
     if ( alpha && !saw_period )
        Perl_croak(aTHX_ "Invalid version format (alpha without decimal)");
 
+    if ( alpha && saw_period && width == 0 )
+       Perl_croak(aTHX_ "Invalid version format (misplaced _ in number)");
+
     if ( saw_period > 1 )
        qv = 1; /* force quoted version processing */