PAR::Indexer - Scan a PAR distro for packages and scripts
use PAR::Indexer qw(scan_par_for_packages scan_par_for_scripts dependencies_from_meta_yml); my $pkgs_hash = scan_par_for_packages($parfile); my $scripts_hash = scan_par_for_scripts($parfile); my $dependencies = dependencies_from_meta_yml(\%meta_yml_hash);
This module contains code for scanning a PAR distribution for packages and scripts. The code was adapted from the PAUSE indexer.
This module is used by PAR::Repository for injection of new PAR distributions.
None by default, but you can choose to export subroutines with the typical Exporter semantics.
Exporter
First argument must be the path and file name of a PAR distribution. Scans that distribution for .pm files and scans those for packages and versions. Returns a hash of the package names as keys and hash refs as values. The hashes contain the path to the file in the PAR as the key "file" and (if found) the version of the package is the key "version".
Returns undef on error.
(The structure returned should be exactly what you get when you transform the provides section of a META.yml file into a Perl data structure using a YAML reader.)
provides
First argument must be the path and file name of a PAR distribution. Scans that distribution for executable files and scans those for versions. Returns a hash of the script names as keys and hash refs as values. The hashes contain the path to the file in the PAR as the key "file" and (if found) the version of the script as the key "version".
Determine the dependencies declared in META.yml. Expects a reference to a hash containing the parsed YAML tree as first argument.
Returns essentially the merged configure_requires, build_requires, and requires hashes from the META.yml. The order of precedence is <requires build_requires > configure_requires>>. If none of the three sections is found, the function returns false. If any one of them was found (even if empty), a hash reference will be returned.
configure_requires
build_requires
requires
<requires
Steffen Mueller, <smueller@cpan.org>
The original code for scanning modules was taken from the PAUSE sources which were written by Andreas Koenig.
Copyright 2006-2009 by Steffen Mueller
Except for the code copied from the PAUSE scanner which is (C) Andreas Koenig.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.
To install PAR::Indexer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PAR::Indexer
CPAN shell
perl -MCPAN -e shell install PAR::Indexer
For more information on module installation, please visit the detailed CPAN module installation guide.