CPAN::...ersion(3pm)

πŸ“¦
version 20260622.001 Β· 3 versions
, in ubuntu stonking

πŸ’– 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 in ARRAY_REF that live inside RANGE. lowkey she's just a filter on ARRAY_REF, keeping only the values where in_range says true. queen behavior honestly. πŸ‘‘
my @matching = $cav->affected_versions( \@versions, $range );
  • in_range( VERSION, RANGE ) β€” returns true if VERSION is contained in RANGE, and false otherwise. VERSION is literally any sort of Perl version you want, like 1.23 or 1.2.3. and RANGE? 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 is CPAN::...ersion(3pm) β€” the name got cropped for the header, but the real one is CPAN::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