stringify#

Render a version object as a string, using the form it was created in.

Synopsis#

my $s = $v->stringify;
my $s = "$v";           # same thing, via overloaded ""

Interpolating a version object into a string calls stringify. A dotted-integer object prints as v1.2.3; a decimal object prints as the original decimal string, preserving trailing zeros and underscores.

What you get back#

A plain Perl string. No trailing newline, no quotes.

Examples#

Dotted-integer round-trips through normal form:

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

Decimal keeps its exact spelling:

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

Differences from upstream#

Fully compatible with upstream version 0.9929.

See also#

  • numify — the decimal numeric form, always

  • normal — the dotted-integer form, always

  • is_qv — tells you which of the two stringify will pick