Re: [Module-build-general] [BUG] non-numeric $VERSION comparison error
Status: Beta
Brought to you by:
kwilliams
|
From: Steve P. <sp...@qu...> - 2003-07-31 18:41:50
|
On Tuesday, July 29, 2003, at 08:48 pm, Ken Williams wrote:
> On Tuesday, July 29, 2003, at 06:00 AM, Steve Purkis wrote:
>
>> [snip - version bug]
>
> Good catch. The version comparison stuff probably needs some work,
> and I'm not sure I'm completely up-to-date on the Totally Correct way
> to compare version numbers/strings. Do you know much about this?
I'm not too up-to-date on them either, I'm afraid. But I reckon John
Peacock's version.pm would be a good place to start.
I suppose it's worth asking this: why not use version objects?
> (By the way, you probably should use 'build_requires' rather than
> 'requires' for the Module::Build dependency. I'm sure that has the
> same bug, though.)
Yup, that was for sake of argument. Still happens when you use
'build_requires'..
Further investigation leads me to an eval() in
M::B::Base->check_installed_status:
...
unless (eval "\$status{have} $op \$version") {
...
Which works for most things. I think it break because of how perl does
SV -> NV conversions [1]:
'0.03_01' > '0.03' == false
Because '0.03_01' is converted to 0.03. But:
0.03_01 > 0.03 == true
Because 0.03_01 is really 0.0301.
-Steve
[1] - I don't remember if this has changed over the last versions of
perl...
|