About finding module dependencies

Yet again I stumble upon the question: What modules do I have to install?

I found a recent discussion on stackoverflow, an old discussion of perlmonks, and some modules (Perl::PrereqScanner, used by Dist::Zilla; Module::ScanDeps, used by PAR; and CPAN::FindDependencies, as seen on http://deps.cpantesters.org/).

PrereqScanner does only static checking (i.e. it looks at the source), ScanDeps does both static and dynamic checking (i.e. it first looks at the source and then runs it). FindDependencies seems to examine Makefile.PL and Build.PL.

And then there's the something between the static and dynamic checking: Load a file, don't run it, and print %INC. (Since in the perl world "loading a module" means running code, this is definitely on the dynamic side.)

Neither of these approaches does what I want: Look at sources and tell me what modules I have to install. ScanDeps comes close: it excludes modules from the Perl distro. From its output I have to guess what modules to install: I guess that I get

'YAML::Dumper::Base'               => '0.72',
'YAML::Node'                       => '0.72',
'YAML::Base'                       => '0.72',
'YAML::Error'                      => '0.72',
'YAML::Loader::Base'               => '0.72'

by installing YAML.

Is there a tool that helps me answering my question?

2 Comments

If you combine ScanDeps with carton functionality you should get what you want. Carton is able to build a tree of dependencies from a list and then print out only the deps that appear at a depth of 1.

Leave a comment

About glauschwuffel

user-pic perlanalyst, testing, compilers