.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Version::Util 3pm" .TH Version::Util 3pm "2018-06-19" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Version::Util \- Version\-number utilities .SH "VERSION" .IX Header "VERSION" This document describes version 0.731 of Version::Util (from Perl distribution Version-Util), released on 2018\-06\-10. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides several convenient functions related to version numbers, e.g. for comparing them. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .ie n .SS "cmp_version($v1, $v2) => \-1|0|1" .el .SS "cmp_version($v1, \f(CW$v2\fP) => \-1|0|1" .IX Subsection "cmp_version($v1, $v2) => -1|0|1" Equivalent to: .PP .Vb 1 \& version\->parse($v1) <=> version\->parse($v2) .Ve .ie n .SS "version_eq($v1, $v2) => \s-1BOOL\s0" .el .SS "version_eq($v1, \f(CW$v2\fP) => \s-1BOOL\s0" .IX Subsection "version_eq($v1, $v2) => BOOL" .ie n .SS "version_ne($v1, $v2) => \s-1BOOL\s0" .el .SS "version_ne($v1, \f(CW$v2\fP) => \s-1BOOL\s0" .IX Subsection "version_ne($v1, $v2) => BOOL" .ie n .SS "version_lt($v1, $v2) => \s-1BOOL\s0" .el .SS "version_lt($v1, \f(CW$v2\fP) => \s-1BOOL\s0" .IX Subsection "version_lt($v1, $v2) => BOOL" .ie n .SS "version_le($v1, $v2) => \s-1BOOL\s0" .el .SS "version_le($v1, \f(CW$v2\fP) => \s-1BOOL\s0" .IX Subsection "version_le($v1, $v2) => BOOL" .ie n .SS "version_gt($v1, $v2) => \s-1BOOL\s0" .el .SS "version_gt($v1, \f(CW$v2\fP) => \s-1BOOL\s0" .IX Subsection "version_gt($v1, $v2) => BOOL" .ie n .SS "version_ge($v1, $v2) => \s-1BOOL\s0" .el .SS "version_ge($v1, \f(CW$v2\fP) => \s-1BOOL\s0" .IX Subsection "version_ge($v1, $v2) => BOOL" .ie n .SS "version_between($v, $v1, $v2[, $v1b, $v2b, ...]) => \s-1BOOL\s0" .el .SS "version_between($v, \f(CW$v1\fP, \f(CW$v2\fP[, \f(CW$v1b\fP, \f(CW$v2b\fP, ...]) => \s-1BOOL\s0" .IX Subsection "version_between($v, $v1, $v2[, $v1b, $v2b, ...]) => BOOL" .ie n .SS "version_in($v, $v1[, $v2, ...]) => \s-1BOOL\s0" .el .SS "version_in($v, \f(CW$v1\fP[, \f(CW$v2\fP, ...]) => \s-1BOOL\s0" .IX Subsection "version_in($v, $v1[, $v2, ...]) => BOOL" .ie n .SS "min_version($v1, ...) => $max_v" .el .SS "min_version($v1, ...) => \f(CW$max_v\fP" .IX Subsection "min_version($v1, ...) => $max_v" .ie n .SS "max_version($v1, ...) => $max_v" .el .SS "max_version($v1, ...) => \f(CW$max_v\fP" .IX Subsection "max_version($v1, ...) => $max_v" .ie n .SS "add_version($v, $increment) => $new_v" .el .SS "add_version($v, \f(CW$increment\fP) => \f(CW$new_v\fP" .IX Subsection "add_version($v, $increment) => $new_v" Add \f(CW$increment\fR to version \f(CW$v\fR. Both increment and version must match: .PP .Vb 1 \& /\eAv?\ed{1,3}(?:\e.\ed{1,3}){0,2}\ez/ .Ve .PP so trial/dev releases like \f(CW\*(C`v1.2.3_1\*(C'\fR are not currently supported. Some examples: .PP .Vb 6 \& 0.1 + 0.1 \-> 0.2 \& 0.01 + 0.001 \-> 0.011 \& 0.01 + 0.1 \-> 0.11 \& 0.9 + 0.1 \-> 1.0 \& 0.99 + 0.1 \-> 1.09 \& 1.1.0 + 0.0.1 \-> 1.1.1 .Ve .ie n .SS "subtract_version($v, $decrement) => $new_v" .el .SS "subtract_version($v, \f(CW$decrement\fP) => \f(CW$new_v\fP" .IX Subsection "subtract_version($v, $decrement) => $new_v" Subtract \f(CW$decrement\fR from version \f(CW$v\fR. This is the reverse operation for \&\f(CW\*(C`add_version\*(C'\fR. .PP Will die if the result is negative. .SH "HOMEPAGE" .IX Header "HOMEPAGE" Please visit the project's homepage at . .SH "SOURCE" .IX Header "SOURCE" Source repository is at . .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests on the bugtracker website .PP When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. .SH "SEE ALSO" .IX Header "SEE ALSO" version .SH "AUTHOR" .IX Header "AUTHOR" perlancar .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2018, 2014 by perlancar@cpan.org. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.