On Thu Feb 05 14:06:41 2015, MISHIKAL wrote:
Show quoted text> IO::Socket::IP assumes that all versions of IO::Socket are numeric.
> However, that is not the case. For example, the version of IO::Socket
> in SLES is:
>
> perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION'
> IO::Socket
> 1.30_01
>
> This causes IO::Socket::IP to throw an error every time it is loaded
> at this line:
>
> if( $IO::Socket::VERSION < 1.35 ) {
>
> Argument "1.30_01" isn't numeric in numeric lt (<) at IO/Socket/IP.pm
> line 920, <DATA> line 290.
Ref:
http://perldoc.perl.org/perlmodstyle.html#Version-numbering
If you want to release a 'beta' or 'alpha' version of a module but don't want CPAN.pm to
list it as most recent use an '_' after the regular version number followed by at least 2
digits, eg. 1.20_01. If you do this, the following idiom is recommended:
$VERSION = "1.12_01";
$XS_VERSION = $VERSION; # only needed if you have XS code
$VERSION = eval $VERSION;
With that trick MakeMaker will only read the first line and thus read the underscore,
while the perl interpreter will evaluate the $VERSION and convert the string into a
number. Later operations that treat $VERSION as a number will then be able to do so
without provoking a warning about $VERSION not being a number.
Based on that, one might argue that IO::Socket might have the 'bug' here (assuming there's no $VERSION = eval $VERSION;). Of course, there's plenty of room for debate there.