Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading all dependencies for a Perl module

This may be a duplicate question, so pardon my search skills.

I need to download all dependencies for a specific Perl module (local::lib and others) on a Windows/cygwin machine (with Perl 5.10.1) and move them to a Solaris machine (with Perl 5.8.8) that has no Internet connection.

I have seen minicpan suggested in this question, but creating a complete replica of a CPAN is not an option as I'm on a corporate network with limited bandwidth. CPAN::Mini has some filtering options, but it deals with paths instead of dependencies.

Is there a way to accomplish this?

Thanks,

Ivan

like image 224
imiric Avatar asked May 10 '11 13:05

imiric


People also ask

How do I load a Perl module?

In this case, you need to create a new file named FileLogger.pm . pm stands for Perl module. Third, make the FileLogger module a package by using the syntax: package FileLogger; at the top of the FileLogger.pm file. Fourth, write the code for subroutines and variables, and put the code into the FileLogger.pm file.


2 Answers

Check out the cpan2dist utility contained in the Perl distribution. (It's in /usr/bin in my Cygwin installation.)

cpan2dist --help

Will create a distribution of type FMT of the modules specified on the command line, and all their prerequisites.

Can also create a distribution of type FMT from a local archive and all it's prerequisites

Haven't tried it, but it sounds like what you're after.

like image 83
Lumi Avatar answered Oct 17 '22 04:10

Lumi


cpanminus has an option to do exactly that: --scandeps and --save-dists. Read more about that option on a blog post explaining the new features of cpanm 1.4.

like image 4
miyagawa Avatar answered Oct 17 '22 04:10

miyagawa