Subject: | numify() returns unnecessary second triple |
CPAN RT#64635 resolved that:
The "numify" operator has returned trailing zeros (in multiples of 3)
since March 2006 and the POD never got updated.
The documentation was updated to:
numify()
Returns a value representing the object in a pure decimal form without
trailing zeroes.
version->declare('v1.2')->numify; # 1.002
version->parse('1.2')->numify; # 1.200
Yet 0.9918 version (the XS code) returns useless second 000 triplet:
$ perl -Iblib/{lib,arch} -Mversion -e 'print version->parse('v1.2')->numify, qq{$a\n}'
1.002000
This violates the documentation.
I have two proposals:
(1) If this (code or documentation) is a bug it should be fixed.
(2) The "without trailing zeroes" documentation is misleading as 1.200 has clearly trailing zeros. It should be worded better to describe the triples.
Maybe both issues could be simply fixed by removing the "without trailing zeroes" from the documentation leaving the number of trailing zeros an implementation detail. At the end the meaning of numify() is to return a number (as opposed to version dotted string).