Subject: | Inconsisten behaviour between the pure perl and XS versions for three digit numbers |
I was getting fails on 5.6.2 from CPAN testers for my
Parse::HTTP::UserAgent. See this for example:
http://www.nntp.perl.org/group/perl.cpan.testers/2009/08/msg5191895.html
First, a little background:
Since I got all tests passing under $] >= 5.008 I've assumed that 5.6.2
is the source. However after setting a VM to test 5.6.1 I saw that
version fails to compile and installed the pure perl version instead.
And got the exact failure. But then realised that ::vpp could be the
problem and tried ::vpp under 5.10 and got the same error.
The problem seems to reside in version::vpp::_un_vstring(). I've
checked the XS code too, but it seemed similar. However, I'm not a
experienced C coder.
Test case: try to run this with both the XS version and the Pure Perl
version:
print version->new("420")->numify;
version::vpp::_un_vstring() makes it v52.50.48 while the XS version
does not.
I'm currently using this work around to fix the issue:
# if version::vpp is used it'll identify 420 as a v-string
# add a floating point to fool it
$v .= '.0' if index($v, '.') == -1;
my $rv = version->new("$v")->numify;
return $rv;
however a fix to this issue will be much better. or you can just change
the XS version if this is the expected behaviour. The interfaces must
be identical IMO.
Cheers,
Burak