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

In my Redhat 5 machine, I have a WWW::Mechanize (version 1.56) and LWP::UserAgent (version 5.835). I understand that this is not the latest version, but I want to be able to identify all the dependencies or parents of these modules and download them manually so that I can install them in a new machine.

As far as I can remember, I did something like this to get these modules:
perl -MCPAN -e 'install WWW::Mechanize'
But the above cannot be done in the new machine since it is restricted from contacting the outside world. Is there a simpler and efficient way to identifying all the parent / dependencies of the above modules and installing them on the new machine.

Thanks.

Replies are listed 'Best First'.
Re: Install Modules
by ambrus (Abbot) on Jun 28, 2011 at 09:28 UTC

    The cpan search page for the WWW-Mechanize distro has a link to a page that lists all the dependencies of that module, recursively. This fails for a few modules, and it also gives the dependencies for the latest versions only, not for the particular version you mentioned, but that usually shouldn't be a too large problem. Note that you can choose a perl core version on that webpage and then it will automatically mark those dependencies that are already in the perl core.

Re: Install Modules
by armstd (Friar) on Jun 28, 2011 at 05:57 UTC

    If you can build a second host similar to the restricted host, you can do the work there, and transfer it over. Perhaps a chroot'd environment would be sufficient.

    It may be a fair assumption that you'll need to do it again in the future as your needs change. Having a "build" environment for managing that restricted configuration will come in handy.

    It really comes down to the restrictions of that environment. If you really must trust that everything done to that host has been done without external access, a non-restricted build environment may not be an option. Not having access to an external yum repo will certainly help keep that build environment as similar as possible as well.

    --Dave

Re: Install Modules
by jonix (Friar) on Jun 28, 2011 at 08:24 UTC
    Have a look here:
    PREREQ_PM => { 'Carp' => 0, 'File::Temp' => 0, 'FindBin' => 0, 'Getopt::Long' => 0, 'HTML::Form' => 1.038, 'HTML::HeadParser' => 0, 'HTML::Parser' => 3.33, 'HTML::TokeParser' => 2.28, 'HTTP::Daemon' => 0, 'HTTP::Request' => 1.30, 'HTTP::Response::Encoding' => 0.05, 'HTTP::Server::Simple' => 0.35, 'HTTP::Server::Simple::CGI' => 0, 'HTTP::Status' => 0, 'LWP' => 5.829, 'LWP::UserAgent' => 5.829, 'Pod::Usage' => 0, 'Test::More' => 0.34, 'Test::Warn' => 0.11, 'URI' => 1.36, 'URI::URL' => 0, 'URI::file' => 0, }
    You should check which of these dependencies are already met by your perl distro, then download and install the missing modules and their dependencies first.

    HTH! Jonix