numify#

Render a version as a plain decimal number, with three digits per sub-component.

Synopsis#

my $n = $v->numify;
my $n = 0 + $v;         # same thing, via overloaded 0+

The first component keeps its natural width; every component after the dot is padded or split into three-digit groups. This is the form old-style $VERSION comparisons expected.

What you get back#

A string that reads as a Perl number: integer part, a single dot, then exactly three digits per trailing component.

Examples#

A dotted-integer version collapses into packed three-digit groups:

my $v = version->declare("v1.2.3");
print $v->numify;      # 1.002003

A decimal version is already in numify shape:

my $v = version->new("1.0203");
print $v->numify;      # 1.020300

Use it when an older API expects a float:

require Some::Module;
die "need 1.2.3+" if Some::Module->VERSION->numify < 1.002003;

Differences from upstream#

Fully compatible with upstream version 0.9929.

See also#

  • normal — the dotted counterpart

  • stringify — whichever of the two matches the object’s origin