title: How to bundle modules for an offline server with cpanm
body: <p>I would like to do <code>cpanm SomeModule</code> to install <code>SomeModule</code> 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 <code>cpanm</code> is able to download its source modules.</p>
  
  <p>After studying the man page of <code>cpanm</code>, 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.</p>
  
  <p>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). </p>
  
  <p>Can someone give the commands for the dev machine and the target machine?</p>
  
  <p>EDIT: this is specifically about <code>cpanm</code>. Of course, if you can say with authority that it is definitely not possible with <code>cpanm</code>, that would be a valid answer as well...</p>
  
  <p>EDIT: The comments and answers so far suggest using <code>pinto</code> or <code>minicpan</code> to create a bundle of CPAN module sources. This works well (especially <code>pinto</code> is quite trivial to use for this). I used <code>pinto</code> now to solve my current problem, but still, Pinto itself has a <em>lot</em> of prerequisite modules (>100 compared to Perl-Core). My hope with this question was that <code>cpanm</code>, 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.</p>