1Version::Next(3)      User Contributed Perl Documentation     Version::Next(3)
2
3
4

NAME

6       Version::Next - increment module version numbers simply and correctly
7

VERSION

9       version 1.000
10

SYNOPSIS

12         use Version::Next qw/next_version/;
13
14         my $new_version = next_version( $old_version );
15

DESCRIPTION

17       This module provides a simple, correct way to increment a Perl module
18       version number.  It does not attempt to guess what the original version
19       number author intended, it simply increments in the smallest possible
20       fashion.  Decimals are incremented like an odometer.  Dotted decimals
21       are incremented piecewise and presented in a standardized way.
22
23       If more complex version manipulation is necessary, you may wish to
24       consider Perl::Version.
25

USAGE

27       This module uses Sub::Exporter for optional exporting.  Nothing is
28       exported by default.
29
30   "next_version"
31         my $new_version = next_version( $old_version );
32
33       Given a string, this function make the smallest logical increment and
34       returns it.  The input string must be a "lax" version numbers as
35       defined by the version module.  The string "undef" is treated as 0 and
36       incremented to 1.  Leading or trailing periods have a 0 (or "v0")
37       prepended or appended as appropriate.  For legacy reasons, given no
38       argument or a literal "undef" (not the string "undef"), the function
39       returns 0.
40
41       Decimal versions are incremented like an odometer, preserving the
42       original number of decimal places.  If an underscore is present
43       (indicating an "alpha" version), its relative position is preserved.
44       Examples:
45
46         0.001    ->   0.002
47         0.999    ->   1.000
48         0.1229   ->   0.1230
49         0.12_34  ->   0.12_35
50         0.12_99  ->   0.13_00
51
52       Dotted-decimal versions have the least significant element incremented
53       by one.  If the result exceeds 999, the element resets to 0 and the
54       next most significant element is incremented, and so on.  Any leading
55       zero padding is removed.  Examples:
56
57        v1.2.3     ->  v1.2.4
58        v1.2.999   ->  v1.3.0
59        v1.999.999 ->  v2.0.0
60
61       NOTE: Due to changes in the interpretation of dotted-decimal version
62       numbers with alpha elements in version 0.9913 and later, the notion of
63       the 'next' dotted-decimal alpha is ill-defined.  Version::Next no
64       longer supports dotted-decimals with alpha elements and a fatal
65       exception will be thrown if one is provided to "next_version".
66

SEE ALSO

68       •   version
69
70       •   Perl::Version
71

SUPPORT

73   Bugs / Feature Requests
74       Please report any bugs or feature requests through the issue tracker at
75       <https://github.com/dagolden/Version-Next/issues>.  You will be
76       notified automatically of any progress on your issue.
77
78   Source Code
79       This is open source software.  The code repository is available for
80       public review and contribution under the terms of the license.
81
82       <https://github.com/dagolden/Version-Next>
83
84         git clone https://github.com/dagolden/Version-Next.git
85

AUTHOR

87       David Golden <dagolden@cpan.org>
88

CONTRIBUTOR

90       Grzegorz Rożniecki <xaerxess@gmail.com>
91
93       This software is Copyright (c) 2016 by David Golden.
94
95       This is free software, licensed under:
96
97         The Apache License, Version 2.0, January 2004
98
99
100
101perl v5.32.1                      2021-01-27                  Version::Next(3)
Impressum