Version::Dotted::Odd - Odd/even versioning scheme
Version v0.0.1, released on 2017-01-04 21:35 UTC.
Version::Dotted and its subclasses are authoring time extensions to core version class: they complement version with bump operation and implement alternative trial version criteria.
Version::Dotted
version
This is Version::Dotted::Odd module documentation. However, read Version::Dotted module documentation first, since it contains many relevant details.
Version::Dotted::Odd
General topics like getting source, building, installing, bug reporting and some others are covered in the README.
use Version::Dotted::Odd; # import nothing use Version::Dotted::Odd 'qv'; # import qv # Construct: $v = Version::Dotted::Odd->new( v1.0 ); # v1.0.0 (at least 3 parts) $v = qv( v1.0.2.5 ); # v1.0.2.5 # Release status: $bool = $v->is_trial; # true if the second part is odd. # See Version::Dotted for other methods.
This is subclass of Version::Dotted. Two features distinct it from the parent:
Version object always has at least 3 parts.
$v = qv( v1 ); # v1.0.0 $v->part( 0 ) == 1; # Parts 0, 1, 2 are always defined. $v->part( 1 ) == 0; # Zero if not specified explicitly. $v->part( 2 ) == 0; # ditto $v->part( 3 ) == undef; # But may be defined.
The second part defines the release status: odd number denotes a trial release.
$v = qv( v1.0 ); # $v == v1.0.0 $v->is_trial; # false $v->bump( 1 ); # $v == v1.1.0 $v->is_trial; # true
Such versioning scheme was used by Linux kernel (between 1.0 and 2.6) and still used by Perl.
Minimal number of parts, read-only.
$int = Version::Dotted::Odd->min_len; # == 3
Version::Dotted::Odd objects always have at least 3 parts.
Returns true in case of trial version, and false otherwise.
$bool = $v->is_trial;
A version is considered trial if the second part is an odd number:
qv( v1.1.3 )->is_trial; # true qv( v1.2.0 )->is_trial; # false
Van de Bugger <van.de.bugger@gmail.com>
Copyright (C) 2017 Van de Bugger
License GPLv3+: The GNU General Public License version 3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
To install Version::Dotted, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Version::Dotted
CPAN shell
perl -MCPAN -e shell install Version::Dotted
For more information on module installation, please visit the detailed CPAN module installation guide.