Subject: | Confused by leading zeroes |
Although it doesn't outright state so, the docs imply that in groups of pure digits, that leading zeroes ought to be ignored. The docs state:
If digit groups are being compared on both sides, a numeric comparison is used
So we ought to expect that "2.0.0" and "2.000.0", say, compare equal. But yet:
$ perl -MSort::Versions -E'say "OK" if versioncmp("2.0.0", "2.0.0") == 0'
OK
$ perl -MSort::Versions -E'say "OK" if versioncmp("2.0.0", "2.000.0") == 0'
(no output)
$ perlmodversion Sort::Versions
1.62
--
Paul Evans