I would like to do cpanm SomeModule
to install SomeModule
together with about 10 dependencies, but the target server has no internet access. I do have a very similar development machine (same Perl environment, same Perl version) where cpanm
is able to download its source modules.
After studying the man page of cpanm
, I have the feeling that I can create a tarball on the development machine, transfer that to the server, and use it to install the modules in one go.
Unfortunately, I do not seem to find which exact combination it is. Especially, as on the dev machine the modules are already installed, I need to force it to still add all the dependencies to the tarball (excluding core modules of course).
Can someone give the commands for the dev machine and the target machine?
EDIT: this is specifically about cpanm
. Of course, if you can say with authority that it is definitely not possible with cpanm
, that would be a valid answer as well...
EDIT: The comments and answers so far suggest using pinto
or minicpan
to create a bundle of CPAN module sources. This works well (especially pinto
is quite trivial to use for this). I used pinto
now to solve my current problem, but still, Pinto itself has a lot of prerequisite modules (>100 compared to Perl-Core). My hope with this question was that cpanm
, which is a standalone, installation-less script, can do it itself (it has extensive options that kind of sound like they could go into that direction). That would be nice for bootstrapping Perl installations without large overheads.