Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Determining module dependencies

by echo (Pilgrim)
on Oct 12, 2001 at 14:29 UTC ( #118441=perlquestion: print w/replies, xml ) Need Help??

echo has asked for the wisdom of the Perl Monks concerning the following question:

I'm soon to install an application on a box on which has no Internet access. Therefore my plan is to bring along a CD with tarballs for all the modules my application requires. I'd like to be make sure I have all the dependencies covered though, is there a way to determine them in advance?

Replies are listed 'Best First'.
Re: Determining module dependencies
by Fletch (Chancellor) on Oct 12, 2001 at 17:29 UTC
    END { print "$_ => $INC{$_}" for sort keys %INC }

    Or getting slightly fancy (but not foolproof)

    package DumpPkgs; use Filter::Util::Call; sub import { my( $type ) = @_; filter_add( bless { } ); } sub filter { my $self = shift; my $status; if( ($status = filter_read()) > 0 ) { print "Used $1\n" while /use\s+(\S+)/g } $status; } 1;

    You also could use the autobundle command to generate a bundle of what's currently installed on the machine.

Re: Determining module dependencies
by MZSanford (Curate) on Oct 12, 2001 at 14:37 UTC
    You could run your code under the debugger and use the V command to examine what is being loaded ... or, you could add some code (maybe in an END block) to print out the contents of %INC (i think it holds that info)

    Last thought would be to use perl -Dp and some grepping.
    The requirements change because they don't know what they want, or how much they own you.
Re: Determining module dependencies
by andreychek (Parson) on Oct 13, 2001 at 05:42 UTC
    This isn't anywhere near as slick as fletch's solution.. however, I know you're a mod_perl guy.. so if you have your application running under mod_perl, you could always make use of mod_perl's status page, which lists all the loaded modules.

    Althought I know you know this, for the benefit of everyone else, you can put this code into your httpd.conf to give yourself access to a mod_perl status report:
    <Location /perl-status> SetHandler perl-script PerlHandler Apache::Status </Location>
    Then you just fire up your browser, and wander over to

    So if project X that you're working on now is the only Perl app loaded under mod_perl, it'd be pretty simple to figure out which modules it's using.

    TMTOWTDI ;-)


      Get Devel::Modlist and then run
      perl -d:Modlist=stop,path
      which should give you all modules along with their path for
      The advantage is that you don't have to know all the modules installed.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://118441]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2022-01-20 11:07 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (56 votes). Check out past polls.