Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Perl Module Dependencies

by dimishome (Beadle)
on Nov 09, 2006 at 19:19 UTC ( [id://583199]=perlquestion: print w/replies, xml ) Need Help??

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

I have run into a tough situation. I need to get a list of installed perl modules and versions (accomplished using ExtUtils::Installed). Now I need to take the list of modules and verify that all the dependencies are installed. I attempted to use the CPAN::Unwind but that demanded that every checked module be downloaded from CPAN and that is not an option when testing on over 650 servers. Any help would be greatly appreciated.

Replies are listed 'Best First'.
Re: Perl Module Dependencies
by randyk (Parson) on Nov 09, 2006 at 21:03 UTC
    Perhaps Module::ExtractUse would be helpful - this attempts to find all modules used by a given module file.
Re: Perl Module Dependencies
by xdg (Monsignor) on Nov 10, 2006 at 03:33 UTC

    If you already have the list of modules, what about the brute-force approach of just trying to load them? If the load fails, it's likely to be a dependency failure -- and you can parse the failure message to confirm it.

    for my $mod ( @modules ) { eval "require $mod" or print "$mod failed\n"; }

    That won't necessarily detect run-time dependencies, but that's tricky anyway.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      If any one cares, I found a module that will almost do everything I need (Module::ScanDeps).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-18 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found