| 1 |
NAME |
| 2 |
Version::Util - Version-number utilities |
| 3 |
|
| 4 |
VERSION |
| 5 |
This document describes version 0.732 of Version::Util (from Perl |
| 6 |
distribution Version-Util), released on 2022-09-22. |
| 7 |
|
| 8 |
DESCRIPTION |
| 9 |
This module provides several convenient functions related to version |
| 10 |
numbers, e.g. for comparing them. |
| 11 |
|
| 12 |
FUNCTIONS |
| 13 |
cmp_version($v1, $v2) => -1|0|1 |
| 14 |
Equivalent to: |
| 15 |
|
| 16 |
version->parse($v1) <=> version->parse($v2) |
| 17 |
|
| 18 |
version_eq($v1, $v2) => BOOL |
| 19 |
version_ne($v1, $v2) => BOOL |
| 20 |
version_lt($v1, $v2) => BOOL |
| 21 |
version_le($v1, $v2) => BOOL |
| 22 |
version_gt($v1, $v2) => BOOL |
| 23 |
version_ge($v1, $v2) => BOOL |
| 24 |
version_between($v, $v1, $v2[, $v1b, $v2b, ...]) => BOOL |
| 25 |
version_in($v, $v1[, $v2, ...]) => BOOL |
| 26 |
min_version($v1, ...) => $max_v |
| 27 |
max_version($v1, ...) => $max_v |
| 28 |
add_version($v, $increment) => $new_v |
| 29 |
Add $increment to version $v. Both increment and version must match: |
| 30 |
|
| 31 |
/\Av?\d{1,3}(?:\.\d{1,3}){0,2}\z/ |
| 32 |
|
| 33 |
so trial/dev releases like "v1.2.3_1" are not currently supported. Some |
| 34 |
examples: |
| 35 |
|
| 36 |
0.1 + 0.1 -> 0.2 |
| 37 |
0.01 + 0.001 -> 0.011 |
| 38 |
0.01 + 0.1 -> 0.11 |
| 39 |
0.9 + 0.1 -> 1.0 |
| 40 |
0.99 + 0.1 -> 1.09 |
| 41 |
1.1.0 + 0.0.1 -> 1.1.1 |
| 42 |
|
| 43 |
subtract_version($v, $decrement) => $new_v |
| 44 |
Subtract $decrement from version $v. This is the reverse operation for |
| 45 |
"add_version". |
| 46 |
|
| 47 |
Will die if the result is negative. |
| 48 |
|
| 49 |
HOMEPAGE |
| 50 |
Please visit the project's homepage at |
| 51 |
<https://metacpan.org/release/Version-Util>. |
| 52 |
|
| 53 |
SOURCE |
| 54 |
Source repository is at |
| 55 |
<https://github.com/perlancar/perl-Version-Util>. |
| 56 |
|
| 57 |
SEE ALSO |
| 58 |
version |
| 59 |
|
| 60 |
AUTHOR |
| 61 |
perlancar <[email protected]> |
| 62 |
|
| 63 |
CONTRIBUTOR |
| 64 |
Steven Haryanto <[email protected]> |
| 65 |
|
| 66 |
CONTRIBUTING |
| 67 |
To contribute, you can send patches by email/via RT, or send pull |
| 68 |
requests on GitHub. |
| 69 |
|
| 70 |
Most of the time, you don't need to build the distribution yourself. You |
| 71 |
can simply modify the code, then test via: |
| 72 |
|
| 73 |
% prove -l |
| 74 |
|
| 75 |
If you want to build the distribution (e.g. to try to install it locally |
| 76 |
on your system), you can install Dist::Zilla, |
| 77 |
Dist::Zilla::PluginBundle::Author::PERLANCAR, |
| 78 |
Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two |
| 79 |
other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps |
| 80 |
required beyond that are considered a bug and can be reported to me. |
| 81 |
|
| 82 |
COPYRIGHT AND LICENSE |
| 83 |
This software is copyright (c) 2022, 2018, 2014 by perlancar |
| 84 |
<[email protected]>. |
| 85 |
|
| 86 |
This is free software; you can redistribute it and/or modify it under |
| 87 |
the same terms as the Perl 5 programming language system itself. |
| 88 |
|
| 89 |
BUGS |
| 90 |
Please report any bugs or feature requests on the bugtracker website |
| 91 |
<https://rt.cpan.org/Public/Dist/Display.html?Name=Version-Util> |
| 92 |
|
| 93 |
When submitting a bug or request, please include a test-file or a patch |
| 94 |
to an existing test-file that illustrates the bug or desired feature. |
| 95 |
|