PerlReq::Utils(3pm)
π PerlReq::Utils π
okay bestie, so this is PerlReq::Utils, and it lives in section 3pm of the manual (that's the "User Contributed Perl Documentation" shelf, iykyk). Think of it as the little helper drawer that B::PerlReq, perl.req and perl.prov all raid when they need something done. It's giving backstage crew energy β never in the spotlight, always holding the whole show up. π
β¨ NAME β¨
PerlReq::Utils β all the auxiliary routines for B::PerlReq, perl.req and perl.prov. Little sidekick functions, big main character job. π«Ά
πΈ DESCRIPTION πΈ
This module hands you the following convenience functions, and honestly? They're all pretty iconic in their own lowkey way:
path2modβ turns a file path into a module name. So like,File/Find.pmbecomesFile::Find. Slashies out, colons in, periodt. πmod2pathβ the exact opposite glow-up: module name to file path.File::FindbecomesFile/Find.pm. π¦path2depβ converts a file path into the conventional dependency name. SoFile/Find.pmbecomesperl(File/Find.pm). Not me β heads up though, this is different from the RedHat conventional formperl(File::Find). Don't get it twisted bestie. πmod2depβ converts a module name into the conventional dependency name.File::Findbecomesperl(File/Find.pm). And yeah, same disclaimer: this differs from the RedHat conventional formperl(File::Find). πverfβ formats a module version number. Like2.12becomes2.120. Currently it truncates to 3 digits after the decimal point, except when it's all zeroes β e.g.2.000becomes2.0. π
Update: the algorithm got amended in an almost compatible way so that versions don't lose precision when they get truncated. Now it allows one more .ddd series at the end, but .000 is still truncated by default. For example: 2.123 becomes 2.123, and 2.123456 becomes 2.123.456. Look at her go. β¨
verf_perlβ formats a Perl version number, e.g.5.005_03becomes1:5.5.30. π₯sv_versionβ extracts the version number from aB::SVobject. v-strings get converted to floats according to Perl rules, e.g.1.2.3becomes1.002003. πargvβ grabs you a list of files passed on the command line. When the command line is empty, it gets the list from standard input instead, one file per line. It dies when the file list is empty, and it checks that every single file actually exists β otherwise, die again. π Each filename gets canonicalized with theFile::Spec::rel2abs()function (which, mind you, makes no checks against the filesystem). So it's trusting, but also not naive. Vibe check passed. πincβ gets you a list of Perl library paths from the@INCvariable, except for the current directory. TheRPM_PERL_LIB_PATHenvironment variable, if it's set, gets treated as a list of paths separated by colons, and those paths get put in front of the list. Then every path in the list gets canonicalized.
Finally, the RPM_BUILD_ROOT environment variable, if set, is treated as the installation root directory β each element of the list gets prefixed with the canonicalized RPM_BUILD_ROOT path, and those new values go in front of the list. π
And after ALL of that? Only the existent directories are returned. Only the real ones make the cut. π
explodeβ splits a given filename into its prefix (which is a valid Perl library path, according to theinc()function up above) and its basename. If the filename doesn't match any prefix, it returns an empty list. Sorry babe, nothing for you. π
π AUTHOR π
Written by Alexey Tourbin <at@altlinux.org>. Give credit where credit is due, fr fr. π«Ά
π COPYING π
Copyright (c) 2004 Alexey Tourbin, ALT Linux Team.
This is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Slay, legally speaking. βοΈβ¨
π SEE ALSO π
B::PerlReqperl.reqperl.prov
and that's the whole page bestie, no cap. this manual page is from perl v5.42.3, dated 2026-08-19, and it's filed under PerlReq::Utils(3pm) β go forth and canonicalize something. ππ¦π
π¦ where this page comes from
- ubuntu stonking: libb-perlreq-perl 0.82-8build5 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms