Subject: | How to compare version objects |
there is an example in version.pod:
$v1 = version->parse("v0.95.0");
$bool = $v1 < 0.96; # FALSE since 0.96 is v0.960.0
But my test returned true.
----
my $v1 = version->parse("v0.95.0");
my $v2 = 0.96;
say join ' ', $v1, ($v1 < $v2) ? '<' : '>', $v2;
say join ' ', $v1, ($v1 < version->parse($v2)) ? '<' : '>', version->parse($v2);
say join ' ', $v1, ($v1 < version->parse("v$v2")) ? '<' : '>', version->parse("v$v2");
----
v0.95.0 < 0.96
v0.95.0 < 0.96
v0.95.0 < v0.96
----
From my understanding only the last comparison should return true.