v0.6 != v0.6.0 ?

Jasper jaspermccrea at gmail.com
Tue Oct 18 11:56:06 BST 2011


On 18 October 2011 11:19, Chisel <chisel at chizography.net> wrote:
> Is this expected behaviour? I get lost in what versions should and shouldn't
> numify. It definitely doesn't DWIM.
>
> ➔ perl -Mversion -le '$big=version->new("0.6.99");
> $small=version->new("0.6"); print $big; print $small; print
> $big>$small ? "ok":"wuh?"'
> 0.6.99
> 0.6
> wuh?
>
> ➔ perl -Mversion -le '$big=version->new("0.6.99");
> $small=version->new("0.6.0"); print $big->numify; print $small; print
> $big>$small ? "ok":"wuh?"'
> 0.006099
> 0.6.0
> ok
>
> ➔ perl -Mversion -le '$big=version->new("0.6.99");
> $small=version->new("0.6"); print $big->numify; print $small->numify;
> print $big>$small ? "ok":"wuh?"'
> 0.006099
> 0.600
> wuh?


The implication being that you need to know the formatting of your
numbering system from the start, and use it. Which seems not unusually
onerous.

-- 
Jasper



More information about the london.pm mailing list