Perl::...::Fast(3pm)
π NAME π
Perl::MinimumVersion::Fast β bestie, it finds the minimum required version of perl for your Perl code. That's it, that's the job. π
It's living in the Perl::...::Fast(3pm) corner of the User Contributed Perl Documentation, and honestly? Iconic of it.
β¨ SYNOPSIS β¨
use Perl::MinimumVersion::Fast;
my $p = Perl::MinimumVersion::Fast->new($filename);
print $p->minimum_version, "\n";
Likeβ¦ three lines. That's the whole vibe check. π¦
πΈ DESCRIPTION πΈ
Perl::MinimumVersion::Fast takes your Perl source code and calculates the minimum version of perl that's required to actually be able to run it. The way it does this is so smart β because it's built on goccy's Compiler::Lexer, it can figure all this out without having to actually load the code. No loading, no running, no drama. It just knows. π₯
Perl::MinimumVersion::Fast is basically the alternative fast & lightweight implementation of Perl::MinimumVersion. Same energy, less weight, more speed. Periodt.
π METHODS π
π my $p = Perl::MinimumVersion::Fast->new($filename);
π my $p = Perl::MinimumVersion::Fast->new(\$src);
Create a new instance, bestie. You can make your object from a $filename or from a "\$src" in a string. Either way, you get an object. Slay. β¨
π $p->minimum_version();
Gets you the minimum perl version that the code requires. The main character of methods, honestly. π
π $p->minimum_explicit_version()
The minimum_explicit_version method checks through your Perl code for the use of explicit version dependencies, such as:
use 5.006;
require 5.005_03;
Okay so, there's almost always only one of these in a file, right? But if more than one is found, the highest version dependency will be returned. Highest one wins, no cap. π
Returns a version object, or undef if no dependencies could be found. (Yes, undef. It happens. π« )
π $p->minimum_syntax_version()
The minimum_syntax_version method will explicitly test only the Document's syntax to determine its minimum version β to the extent that this is possible. Like, it's doing its best, and its best is genuinely really good. π
Returns a version object, or undef if no dependencies could be found.
π version_markers
This method returns a list of pairs in the form:
($version, \@markers)
Each pair represents all the markers that could be found indicating that the version was the minimum needed version. @markers is an array of strings.
π¨ Bestie, listen. Currently these strings are not as clear as they might be, but this may be changed in the future. In other words: don't rely on them as specific identifiers. I'm so serious. π
π BENCHMARK π
Perl::MinimumVersion::Fast is faster than Perl::MinimumVersion. Because Perl::MinimumVersion::Fast uses Compiler::Lexer, which is a Perl5 lexer implemented in C++. And also because Perl::MinimumVersion::Fast omits some features implemented in Perl::MinimumVersion.
But, but β Perl::MinimumVersion::Fast is really fast. π₯π₯π₯
Rate Perl::MinimumVersion Perl::MinimumVersion::Fast
Perl::MinimumVersion 5.26/s -- -97%
Perl::MinimumVersion::Fast 182/s 3365% --
Look at that rate. 182/s. Ate. π β¨
π LICENSE π
Copyright (C) tokuhirom.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π«Ά THANKS TO π«Ά
Most of documents are taken from Perl::MinimumVersion. Giving credit where credit is due, always. π
π AUTHOR π
tokuhirom <tokuhirom@gmail.com>
π¦ SEE ALSO π¦
- This module using
Compiler::Lexeras a lexer for Perl5 code. - This module is inspired from
Perl::MinimumVersion.
Okay and finally, the receipts π β this whole page is perl v5.40.0, dated 2025-01-11, and it's the Perl::...::Fast(3pm) manual from the User Contributed Perl Documentation. Thanks for coming to my TED talk, go find your minimum version bestie π
β¨π
π¦ where this page comes from
- debian trixie: libperl-minimumversion-fast-perl 0.22-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libperl-minimumversion-fast-perl 0.22-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libperl-minimumversion-fast-perl 0.22-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