Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Module dependencies

by Stegalex (Chaplain)
on Apr 03, 2002 at 15:04 UTC ( [id://156323]=perlquestion: print w/replies, xml ) Need Help??

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

I am developing some XML munging Perl right now that has required me to install CPAN module after CPAN module. I will find that I need to use a particular library and then when I go to install that lib, I will find that I first need to install some other libraries and so on and so on.

Now this doesn't bother me much, but the problem is that after I develop the code I have to hand it over to another group of people (who aren't terribly familiar with things Perlish) and let them install all the modules and my code on a different box. Now since I am a moron and I haven't been keeping a meticulous list of what was installed and in what order, this is going to be a problem.

And now we get to the question: Is there an automated means of determining which modules are dependant upon others? If so, is there a way of producing a list that shows a heirarchical order in which modules must be installed?

For example: I found out that I needed to use XML::LibXML. In order to install this, you must first go to xmlsoft.org and download and install libxml2. You must also install XML::SAX. But before you can install XML::SAX, you must first install File::Temp and XML::NamespaceSupport. After you do this, you can install XML::SAX. After all that, you can install XML::LibXML.

What I would like is an automated means of producing a list as follows:
XML::LibXML --libxml2 --XML::SAX ----File::Temp ----XML::NamespaceSupport
Forgive me if this is totally naive. I like chicken.

Replies are listed 'Best First'.
Re: Module dependencies
by cjf (Parson) on Apr 03, 2002 at 15:13 UTC
Re: Module dependencies
by Fletch (Bishop) on Apr 03, 2002 at 15:55 UTC

      The thread you cited refers to my Devel::Modlist package, but the example they use overlooks an option called "cpandist":

      perl -d:Modlist=cpandist,nocore,stop upj_post.pl

      (The upj_post.pl is one of my sample scripts that demonstrates the SOAP interface to the use Perl; journal system.)

      This produces the output:

      G/GA/GAAS/Digest-MD5-2.16.tar.gz
      G/GA/GAAS/libwww-perl-5.64.tar.gz
      K/KU/KULCHENKO/SOAP-Lite-0.51.tar.gz

      If the cpan option is used instead of cpandist, it simply refers to the first module of a given package, since "install Module" from within the CPAN shell is sufficient:

      perl -d:Modlist -MDevel::Modlist="cpan,noversion,nocore,stop" upj_post.pl

      Digest::MD5
      HTTP::Cookies
      SOAP::Lite

      An important note: all of these examples used the "stop" option, which stops prior to the execution of the program, and prints results then. If any of the libraries listed were to include others, you would see them here unless they were included at compile-time. For example, if the nature of the run included encoding MIME data using base-64, LWP probably doesn't load MIME::Base64 until it is explicitly needed.

      --rjray

        (The upj_post.pl is one of my sample scripts that demonstrates the SOAP interface to the use Perl; journal system.)

        OOooh, where can one obtain said upj_post.pl?

Re: Module dependencies
by trs80 (Priest) on Apr 03, 2002 at 18:23 UTC
    There is a new module on CPAN called CPAN-DistroBuilder that might be worth taking a look at. It was just released within the last few weeks.
Re: Module dependencies
by jeffenstein (Hermit) on Apr 04, 2002 at 07:51 UTC

    For external dependencies, you are on your own.

    However, perldoc perllocal will tell you what additional modules you have installed, and in what order.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-25 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found