Module::CPANfile - Parse cpanfile
use Module::CPANfile; my $file = Module::CPANfile->load("cpanfile"); my $prereqs = $file->prereqs; # CPAN::Meta::Prereqs object $file->merge_meta('MYMETA.json');
Module::CPANfile is a tool to handle cpanfile format to load application specific dependencies, not just for CPAN distributions.
$file = Module::CPANfile->load; $file = Module::CPANfile->load('cpanfile');
Load and parse a cpanfile. By default it tries to load cpanfile in the current directory, unless you pass the path to its argument.
cpanfile
Returns CPAN::Meta::Prereqs object out of the parsed cpanfile.
Returns a hash reference that should be passed to CPAN::Meta::Prereqs->new.
CPAN::Meta::Prereqs->new
$file->merge_meta('META.yml'); $file->merge_meta('MYMETA.json', '2.0');
Merge the effective prereqs with Meta speicifcation loaded from the given META file, using CPAN::Meta. You can specify the META spec version in the second argument, which defaults to 1.4 in case the given file is YAML, and 2 if it is JSON.
Tatsuhiko Miyagawa
cpanfile, CPAN::Meta, CPAN::Meta::Spec
To install Module::CPANfile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::CPANfile
CPAN shell
perl -MCPAN -e shell install Module::CPANfile
For more information on module installation, please visit the detailed CPAN module installation guide.