Package Info

perl-Perl-Version


Parse and manipulate Perl version strings


Development/Libraries/Perl

Perl::Version provides a simple interface for parsing, manipulating and formatting Perl version strings.

Unlike version.pm (which concentrates on parsing and comparing version strings) Perl::Version is designed for cases where you'd like to parse a version, modify it and get back the modified version formatted like the original.

For example:

my $version = Perl::Version->new( '1.2.3' );
$version->inc_version;
print "$version\n";

prints

1.3.0

whereas

my $version = Perl::Version->new( 'v1.02.03' );
$version->inc_version;
print "$version\n";

prints

v1.03.00

Both are representations of the same version and they'd compare equal but their formatting is different.

Perl::Version tries hard to guess and recreate the format of the original version and in most cases it succeeds. In rare cases the formatting is ambiguous. Consider

1.10.03

Do you suppose that second component '10' is zero padded like the third component? Perl::Version will assume that it is:

my $version = Perl::Version->new( '1.10.03' );
$version->inc_revision;
print "$version\n";

will print

2.00.00

If all of the components after the first are the same length (two characters in this case) and any of them begins with a zero Perl::Version will assume that they're all zero padded to the same length.

The first component and any alpha suffix are handled separately. In each case if either of them starts with a zero they will be zero padded to the same length when stringifying the version.


License: Artistic-1.0 or GPL-1.0+
URL: http://search.cpan.org/dist/Perl-Version/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
1.013-bp156.3.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version
1.013-bp155.2.9 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version
1.013-bp154.1.22 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version
1.013-bp153.1.14 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version
1.013-bp152.3.15 info GA Release 2020-04-16 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version
1.013-bp151.3.1 info GA Release 2019-07-16 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version
1.013-bp151.2.14 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version
1.013-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Perl-Version