|Think about Loose Coupling|
Re: using Perl modules on airgapped systemby topher (Scribe)
|on Apr 20, 2013 at 03:40 UTC||Need Help??|
There are a couple of ways you can approach this, depending on your specific requirements and preferences.
First, as a couple people have mentioned, you could look at something like CPAN::Mini. Basically, you'd build a local mirror of the packages you'd need. I'd probably look at this option if I had multiple machines I needed to install to.
The rest of the options assume you have a dev box that is similar to your deployment target, where you can do your initial work.
The second option would be to make use of something like App::FatPacker to help package up your prerequisites into a single file that you could easily copy over. If the systems are substantially similar outside of the Perl modules, this might be among the easiest. Note: if the Perl modules require any compiled libraries, I'm not sure if App::FatPacker grabs them or now.
Similar to the previous option, you could use local::lib to install all of your CPAN modules, then tar up the whole set and copy it to your destination. This will work provided the systems are very similar. This can also be used with App::FatPacker to simplify things. local::lib also includes lib::core::only to make sure you've got your dependencies clear for things like App::FatPacker.
If the dev box and production box are not similar enough for the above options to work, you could use App::perlbrew to install a complete Perl installation, then install your dependencies, and then tar up the whole mess and copy it to your destination. I've done this successfully, so I know it works. It's probably the most time intensive of the solutions, though.