Subject: | Doc bug? |
Module documentation at http://search.cpan.org/~ferreira/Data-VString-0.000_003/lib/
Data/VString.pm has:
And that makes
'0.1' > '0.2'
'0.2.1' < '0.1.3'
'0.11.10' > '0.10.10.10'
and also '0.1' > '0.1.0' (because the first one is shorter).
That doesn't make sense to me. 11.10 > 10.10.10 makes sense to me, because any version
11 will be later / greater than any version 10 thing. But how can 0.1 be > 0.2? 0.2.1 < 0.
1.3? 0.1 > 0.1.0? They look backwards. If that's the behavior of the code, then I would
say the code's design is not useful. The examples below show the behavior I expect:
vstring_satisfy('0.1.1', '> 0, < 0.2, != 0.1.0'); # true
$le = vstring_cmp('1.2.3', '>=', '3.2.1'); # not ok
I think a better example is to show that 10.0.0 > 9.9.9 -- because if you compare them as
strings, "10.0.0" < "9.9.9". That is, this example shows why you can't just use regular
strings.
- Tim McDaniel, tmcd@panix.com