Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Locate modules called by script

by thundergnat (Deacon)
on May 10, 2005 at 14:23 UTC ( [id://455583] : note . print w/replies, xml ) Need Help??


in reply to Locate modules called by script

The Module::ScanDeps module will recursively find all modules used by your scripts. It will also find all core modules, so you need to sort out what you do and don't need.
use strict; use warnings; use Module::ScanDeps; # insert your script(s) name(s) here my @scripts = qw/ myscript.pl /; my $hash_ref = scan_deps( files => \@scripts, recurse => 1, ); print $$hash_ref{$_}->{'key'}."\n" for sort keys %$hash_ref;
Ideally though, you should just use CPAN to install the necessary modules.