This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More liberal parsing of version numbers.
[perl5.git] / lib / CPAN.pm
index 6de43d3..aadc2a9 100644 (file)
@@ -4806,7 +4806,8 @@ sub vstring {
 
 sub readable {
   my($self,$n) = @_;
-  return $n if $n =~ /^[\w\-\+\.]+$/;
+  $n =~ /^([\w\-\+\.]+)/;
+  return $1 if length($1)>0;
   if ($] < 5.006) { # or whenever v-strings were introduced
     # we get them wrong anyway, whatever we do, because 5.005 will
     # have already interpreted 0.2.4 to be "0.24". So even if he