Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

How to find the perl module's dependency modules ?

by vinoth.ree (Parson)
on Aug 07, 2009 at 13:01 UTC ( #786769=perlquestion: print w/ replies, xml ) Need Help??
vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

If I use cpan command It will also install the dependency modules of that module. How do I list a dependency modules of a perl module ? Thanks!

Comment on How to find the perl module's dependency modules ?
Re: How to find the perl module's dependency modules ?
by jettero (Monsignor) on Aug 07, 2009 at 13:08 UTC
    I usually use "look Module::Name" from the cpan shell. Then you get a shell prompt and I either read the Makefile.PL, Build.PL, or execute it (which prints the deps to the terminal).

    -Paul

      I can also see the dependency modules when I install a new perl module, but my expectation is any perl module is available to find the already installed module's dependency modules.

Re: How to find the perl module's dependency modules ?
by moritz (Cardinal) on Aug 07, 2009 at 13:08 UTC
      try Module::ScanDeps ?
Re: How to find the perl module's dependency modules ?
by ww (Bishop) on Aug 07, 2009 at 13:21 UTC
Re: How to find the perl module's dependency modules ?
by Khen1950fx (Canon) on Aug 07, 2009 at 19:42 UTC
    These are a few of my favorite things:

    #!/usr/local/bin/perl use strict; use warnings; use CPAN::FindDependencies; use ExtUtils::MakeMaker qw(prompt); my $mod = prompt("Enter module name: "); my @dependencies = CPAN::FindDependencies::finddeps($mod); foreach my $dep (@dependencies) { print ' ' x $dep->depth(); print $dep->name().' ('.$dep->distribution().")\n"; }
    And this:

    #!/usr/local/bin/perl use strict; use warnings; use B::PerlReq; use ExtUtils::MakeMaker qw(prompt); my $mod = prompt("Enter path to .pm: "); my $prereq = system("perl -MO=PerlReq -d $mod"); print "$prereq\n";
    And this:

    #!/usr/local/bin/perl use strict; use warnings; use ExtUtils::MakeMaker qw(prompt); my $mod = prompt("Enter module name: "); my $info = system("module_info -a $mod"); print "$info\n";

      Thanks ! I used first one.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-07-26 01:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls