Sobrique Sobrique - 2 years ago 91
Perl Question

Bundling up a perl script with its dependencies?

I have a perl script that I've put together to do some monitoring and graphing.

It works nicely on my dev system, where I have carte-blanch to install my own modules from CPAN.

What I'm looking at doing is bundling it up to deploy onto another system. But here's the catch - this other system is 'standalone' and has no network connection. (And I have change control paperwork to fill in, indicating what I'm installing).

As a result, I'd really like a nice easy way to figure out:
- What modules my scripts are making use of. (Including dependencies)
- how to easily grab them (

cpan get
- Is there an easy way to tell what external binaries I'm using? (I'm using for sure
- the former is definitely installed, the latter probably not).

I have a few thoughts on how to do this, but it strikes me as something that should be smoother.

I may also need to deploy a new perl, so I'm pondering whether I'm better off 'installing' the modules with system perl (probably 5.8.8 on RHEL5), or just 'packaging' the whole thing in a directory of it's own with a standalone perl instance.

Answer Source

Use pp to package your script and all dependant modules and libraries into a stand alone executable.

pp -x -o outputfilename

See the documentation for examples of how to link to external shared objects (etc) if required. With pp you don't need perl on the target system where outputfilename will run.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download