Stormyk has asked for the wisdom of the Perl Monks concerning the following question:

I have a general question that should be either obvious or a huge hassle.

I have a chunk of code (system health scripts) that I need to run, which have a bunch of pm files, which in turn also have a tree of modules. Of course the PMs are scattered all over the filesystem.

I need to run these scripts on machines that won't have the same file structure/OS every day. The working assumption is that perl will be available regardless.

I was wondering if there was a way to turn the code into one big chunk of a perlcode, bytecode, or executable. that doesn't need pm's to be in some specific spot to work. pretty much I want to scp the file to a location and run it.

I'll need a reasonable method to re-pack as the scripts backends are changing. As the code might need a new pm that is a few levels deep in the tree.

Thank you for your patience.
Storm
  • Comment on Making a single script from a tree of dependencies.

Replies are listed 'Best First'.
Re: Making a single script from a tree of dependencies.
by Corion (Patriarch) on Jul 19, 2012 at 14:56 UTC

    If you have Perl installed on the target machine, and have no XS dependencies, then App::FatPacker does what you describe.

Re: Making a single script from a tree of dependencies.
by marto (Cardinal) on Jul 19, 2012 at 14:54 UTC

    Use pp to create an executable from your code and dependent modules.

    Update: s/of/from/

    Update 2:

    See also PAR, PAR::FAQ and PAR::Tutorial. I missed the different OS part.

      Thanks, This gives me a direction to pursue.

      or, if you have tk, try tkpp, which can help a lot...

      --linuxkid


      imrunningoutofideas.co.cc