Parse::...ibution(3)

πŸ“¦
version 0.20 Β· 2 versions
, in fedora 44

πŸ’– 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::Metadata may be a better and handier option for you. no shade, just facts.
⚠️ okay important warning moment: Parse::PMFile (and therefore Parse::LocalDistribution too, she inherited it) actually evaluates code in the $VERSION line β€” 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, actually Parse::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 let Parse::PMFile fork while parsing a version (as PAUSE does), set this to true. like, really really. πŸ“
  • USERID, PERMISSIONS β€” Parse::LocalDistribution checks permissions of a package if both USERID and PERMISSIONS are provided. heads up: PERMISSIONS should be an instance of PAUSE::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 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