Version::Compare(3pm)
π NAME π
okay so bestie, gather round β Version::Compare is a lil Perl module that does exactly one iconic thing: it compares version strings. that's it. that's the whole job. and it eats.
β¨ VERSION β¨
version 0.14 β yes queen, we're on 0.14
πΈ SYNOPSIS πΈ
here's the vibe, copy it, paste it, live it:
use Version::Compare;
if(&Version::Compare::version_compare('2.6.26','2.6.0') == 1) {
print "2.6.26 is greater than 2.6.0\n";
}
like. it literally tells you which version is bigger. main character behaviour fr fr π
π NAME π
(again, because the original says it twice and we respect the canon)
Version::Compare β Comparing version strings
π¦ SUBROUTINES/METHODS π¦
max
returns the bigger of the two numerical values. that's it. pick the larger number, no drama, no notes. π«Ά
version_compare
okay this is the star of the show. you give it two unix-style version strings (think 2.6.23.1 and 2.6.33) and it hands you back a sort-like return code:
1β the LHS is bigger (left-hand side ate, periodt)0β they're equal (a tie, how very diplomatic)-1β the RHS is bigger (right-hand side took the crown)
and here's the ordering it lives by, verbatim, no cap:
0.0 < 0.5 < 0.10 < 0.99 < 1 < 1.0~rc1 < 1.0 < 1.0+b1 < 1.0+nmu1 < 1.1 <
2.0
cmp
see version_compare. literally just go read version_compare. it's giving alias energy. π
π AUTHOR π
Dominik Schulz, <dominik.schulz at gauner.org>
π BUGS π
found a bug? a feature request? a lil something that's lowkey not working? please report it to bug-version-compare at rt.cpan.org, or slide through the web interface at:
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Version-Compare>
the deal is: I get notified, and then you automatically get notified of progress on your bug as I make changes. mutual updates, bestie. we love a two-way street. β¨
π SUPPORT π
you can find all the docs for this module with the perldoc command:
perldoc Version::Compare
and you can also go looking for info at:
- RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Version-Compare>
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/Version-Compare>
- CPAN Ratings
<http://cpanratings.perl.org/d/Version-Compare>
- Search CPAN
<http://search.cpan.org/dist/Version-Compare/>
go forth and lurk, it's a vibe π
π LICENSE AND COPYRIGHT π
Copyright 2012 Dominik Schulz
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See <http://dev.perl.org/licenses/> for more information.
π AUTHOR π
(second round, she said it again)
Dominik Schulz <dominik.schulz@gauner.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2012 by Dominik Schulz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
okay that's the whole page bestie, you're officially fluent π
signing off from perl v5.36.0, dated 2022-11-19, filed under Version::Compare(3pm) β slay, stay hydrated, and go compare some versions π§β¨
π¦ where this page comes from
- debian bookworm: libversion-compare-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libversion-compare-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libversion-compare-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libversion-compare-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libversion-compare-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms