The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Version::Dotted::Odd - Use odd/even versioning scheme in your Perl modules

VERSION

Version v0.0.0_05, released on 2016-12-28 19:36 UTC. This is a trial release.

WHAT?

Version::Dotted and its subclasses complement standard version class with version modification operations, which can be useful in distribution release tools.

This is Version::Dotted::Odd module/class documentation. However, read Version::Dotted module/class documentation first, since it contains many relevant details.

General topics like getting source, building, installing, bug reporting and some others are covered in the README.

SYNOPSIS

    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:
    if ( $v->is_trial ) {   # If the second part is odd.
        ...
    };

    # Other methods are inherited from Version::Dotted.

DESCRIPTION

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 numbers 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.

OBJECT METHODS

is_trial

Returns true if the second version part is an odd number, and false otherwise.

SEE ALSO

Version::Dotted

AUTHOR

Van de Bugger <van.de.bugger@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2016 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.