libwww-perl / WWW-Mechanize

Handy web browsing in a Perl object
https://metacpan.org/pod/WWW::Mechanize
Other
68 stars 53 forks source link

Don't use "ge" for version comparison #163

Closed spazm closed 6 years ago

spazm commented 7 years ago

esert...@yahoo.de reported on Oct 11, 2009

In WWW::Mechanize's Makefile.PL I see some version comparisons using the
"ge" operator. This will fail in some distant future:

#!/usr/bin/perl -w
$ExtUtils::MakeMaker::VERSION = '10.01';
if ( $ExtUtils::MakeMaker::VERSION ge '6.45_01' ) {
    warn "yes";
} else {
    warn "no";
}
__END__

Yes, I know, there are ugly warnings if comparing numerically against a
version with underscore. To fix this, users often do "eval" such a version
number:

$ perl -we '$x = eval "6.45_01"; warn $x'
6.4501 at -e line 1.

Regards,
    Slaven

Details

Imported from Google Code issue 135 via archive

Comments

petda...@gmail.com commented on May 4, 2011 :

(No comment was entered for this change.)

mark.sto...@gmail.com commented on Feb 1, 2013 :

I confirmed that this issue is still present in WWW::Mechanize 1.72.
oalders commented 6 years ago

Fixed in 1.86 and likely much earlier as well. https://metacpan.org/source/OALDERS/WWW-Mechanize-1.86/Makefile.PL