Perl::...::Fast(3pm)

πŸ“¦
version 0.22 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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::Lexer as 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