CPAN::...ersion(3pm)
π CPAN::Audit::Version π
okay so bestie, this is a page from the User Contributed Perl Documentation collection, and it's literally the infrastructure to compare versions and version ranges. yes, THE version-comparing infrastructure. she's giving utility, she's giving backbone, she's giving the tool that tells you if your module is in the danger zone. π
β¨ NAME β¨
CPAN::Audit::Version β the infrastructure to compare versions and version ranges π¦
β¨ SYNOPSIS β¨
like, here's the whole vibe in three lines:
use CPAN::Audit::Version;
my $cav = CPAN::Audit::Version->new;
$cav->in_range( $version, $range );
no cap, that's it. that's the entire entry point. π
β¨ DESCRIPTION β¨
πΈ Class methods πΈ
newβ makes you a brand new object. and the way that it ignores all arguments... iconic. it does not care what you pass it. it simply is. π
π¦ Instance methods π¦
affected_versions( ARRAY_REF, RANGE )β you hand her an array reference full of versions, and she hands you back a list of all the versions inARRAY_REFthat live insideRANGE. lowkey she's just a filter onARRAY_REF, keeping only the values wherein_rangesays true. queen behavior honestly. π
my @matching = $cav->affected_versions( \@versions, $range );
in_range( VERSION, RANGE )β returns true ifVERSIONis contained inRANGE, and false otherwise.VERSIONis literally any sort of Perl version you want, like1.23or1.2.3. andRANGE? that's a comma-separated list of range specifications using the comparators<,<=,==,>,>=, or!=. for example>=1.23,<1.45,==1.23, or>1.23. fr fr, that's the whole grammar. β¨
my $version = 5.67;
my $range = '>=5,<6'; # so, all the versions in 5.x
if( $cav->in_range( $version, $range ) ) {
say "$version is within $range";
}
else {
say "$version is not within $range";
}
β¨ LICENSE β¨
Copyright (C) Viacheslav Tykhanovskyi. π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. yes bestie, free as in freedom, go wild (respectfully). π«Ά
β¨ AUTHOR β¨
Viacheslav Tykhanovskyi <viacheslav.t@gmail.com> π
π reminder to my girlies: this page isCPAN::...ersion(3pm)β the name got cropped for the header, but the real one isCPAN::Audit::Version. iykyk.
and that's the whole page!! πβ¨πΈ
big love and thanks to everyone who made it β this shipped as part of perl v5.40.1, dated 2026-07-05, in the User Contributed Perl Documentation section. periodt. π ππ¦
π¦ where this page comes from
- ubuntu stonking: libcpan-audit-perl 20260622.001-1 Β· 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