NAME

Module::MakefilePL::Parse - parse required modules from Makefile.PL

SYNOPSIS

use Module::MakefilePL::Parse;

open $fh, 'Makefile.PL';

$parser = Module::MakefilePL::Parse->new( join(" ", <$fh>) );

$info   = $parser->required;

DESCRIPTION

The purpose of this module is to determine the required modules for older CPAN distributions which do not have META.yml files but use Makefile.PL and ExtUtils::MakeMaker.

Presumably newer style Makefile.PL files which use Module::Install or Module::Build already have META.yml files in their distributions.

Methods

new
$parser = new Modile::MakefilePL::Parse( $script );

Parsers a Makefile.PL script and returns an object. Returns undef if there is a problem.

required
$info = $parser->required;

Returns a hash reference to the PREREQ_PM key in the Makefile.PL script.

CAVEATS

This module does evaluate a portion of the code, so there is a security issue. However, it only evaluates the definition of the PREREQ_PM key in calls to WriteMakefile, which should be more difficult to embed malware in.

Do not run this module on untrusted scripts.

SEE ALSO

Module::Info
Module::Dependency
Module::Depends
Module::ScanDeps

AUTHOR

Robert Rothenberg <rrwo at cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Robert Rothenbeg. All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.