Subject: | highest_explicit_perl_version versus underscore |
Date: | Mon, 09 Jun 2008 10:55:09 +1000 |
To: | bug-perl-critic [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In perlcritic 1.084 and the debian packaged perl 5.10.0 the program
foo.pl below prints
Argument "5.006_000" isn't numeric in subroutine entry at /usr/share/perl5/Perl/Critic/Document.pm line 138.
highest version 5.006_000
where I hoped not to get a warning.
The similar program bar.pl below is a bit worse,
Argument "5.006_003" isn't numeric in subroutine entry at /usr/share/perl5/Perl/Critic/Document.pm line 138.
Argument "5.006_001" isn't numeric in subroutine entry at /usr/share/perl5/Perl/Critic/Document.pm line 138.
highest version 5.006_001
It picks 5.006_001 as the highest where I hoped it would be the
5.006_003.
I struck the foo.pl warning in the cpan "classes" file "classes.pm"
which has a "use 5.006_001;" (among other things). The bar.pl is a
contrivance getting an actual ill effect from the truncated comparing.
I wonder if List::Util::max() in highest_explicit_perl_version() might
be hitting the "numify" of version objects (instead of using their
overloaded ">" etc), that latter unhelpfully returning a non-number like
'5.006_003'. Perhaps highest_explicit_perl_version() might have to use
a "List::Util::reduce()" style to be sure of the comparing.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.