Parse::...ibution(3)
π Parse::LocalDistribution π
okay so bestie, welcome to Parse::LocalDistribution β it's a Perl module, it lives in the User Contributed Perl Documentation section of your friendly neighbourhood man pages, and it does exactly one thing gorgeously: it parses local .pm files as PAUSE does. no cap. that's the whole vibe. π
β¨ SYNOPSIS β¨
use Parse::LocalDistribution;
my $parser = Parse::LocalDistribution->new({ALLOW_DEV_VERSION => 1});
my $provides = $parser->parse('.');
literally three lines and you're done, we love a low-effort icon π
πΈ DESCRIPTION πΈ
so this module is the sister module of Parse::PMFile, and she's giving very much "I do my own thing but we're related." π«Ά
here's the deal: it parses local .pm files β and a META file if there is one β inside a specific directory (or the current directory if you don't specify one, she's chill like that). then it hands you back a hash reference that represents the "provides" information, plus some extra meta data sprinkled on top like glitter. β¨
it's almost the same as what Module::Metadata does β and fun fact bestie, Module::Metadata has been in Perl core since Perl 5.13.9, so she's basically famous. π
but here's the main difference: most of the code in this module is directly taken from the PAUSE code as of June 2013. so:
- need better compatibility with PAUSE? try this. π
- need better performance, safety, or portability in general?
Module::Metadatamay be a better and handier option for you. no shade, just facts.
β οΈ okay important warning moment:Parse::PMFile(and thereforeParse::LocalDistributiontoo, she inherited it) actually evaluates code in the$VERSIONline β inside a Safe compartment, yes, but still β and that can be problematic in some cases. so just, like, be aware. π
one more thing: this module does not provide a feature to extract a distribution. if you're too lazy to implement that yourself (real, honestly, respect), CPAN::ParseDistribution may be another good option. π¦
β¨ METHODS β¨
π new
creates an object. you can pass an optional path and/or an optional hashref to configure it. the options are:
ALLOW_DEV_VERSIONβParse::LocalDistribution(well, actuallyParse::PMFile) usually ignores a version with an underscore, exactly like PAUSE does, because that's a developer release and it should not be indexed, periodt. set this option to true if you happen to need to keep such a version around for better analysis. π§VERBOSEβ set this to true if you need to know some details. nosy bestie energy, valid. πFORKβ if you really need to letParse::PMFilefork while parsing a version (as PAUSE does), set this to true. like, really really. πUSERID,PERMISSIONSβParse::LocalDistributionchecks permissions of a package if bothUSERIDandPERMISSIONSare provided. heads up:PERMISSIONSshould be an instance ofPAUSE::Permissions. unauthorized packages are removed β sorry babe, security is security. πMETA_CONTENTβ if you already have parsed a META file, set this to avoid parsing the same META file again. efficiency queen. β
π¦ parse
may take a path to a local distribution, and returns a hash reference that holds information for the package(s) found in that directory. that's it, that's the girl. π
π SEE ALSO π
most part of this module is derived from PAUSE. give her her flowers. π
<https://github.com/andk/pause>
the following distributions do similar parsing, though the results may differ sometimes (iykyk):
Module::Metadata, CPAN::ParseDistribution
π AUTHOR π
Andreas Koenig <andreas.koenig@anima.de>
Kenichi Ishigaki, <ishigaki@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright 1995 - 2013 by Andreas Koenig <andk@cpan.org> for most of the code.
Copyright 2013 by Kenichi Ishigaki for some.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
okay that's the whole page bestie, you ate that π«Άβ¨ this was Parse::LocalDistribution, documented as part of perl v5.42.0, dated 2026-01-17, and filed under Parse::...ibution(3) in your manual. go forth and parse. ππ
π¦ where this page comes from
- fedora 44: perl-Parse-LocalDistribution 0.20-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms