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

I'm using PAR to package a bunch of standalone scripts as part of a distribution. I have to admit, the motivation is purely to make the source code a little harder to get at. Something about what I'm done is striking me as a bit off though... Q: PAR (pp) packages *everything* (Perl interpreter, modules, etc.) in each executable it generates. Is there a smarter way to package the scripts? I can assume the target machine will have Perl installed.

Replies are listed 'Best First'.
Re: PAR (pp) on lots of standalone scripts
by Corion (Pope) on Jan 28, 2011 at 14:19 UTC

    I'd look at Acme::Bleach - it's the easiest way to hide your source code.

Re: PAR (pp) on lots of standalone scripts
by marto (Archbishop) on Jan 28, 2011 at 14:31 UTC
      I'm not looking to get rock-solid encryption, but rather just hide it from mildly curious eyes. I'm just concerned that using pp on everything balloons the installation size. Seems foolish to include a Perl interpreter and every module the script uses *for every script*.

        I was simply commenting on your suggestion of using pp to 'hide' the source, since it extracts everything on execution, and as I pointed out in the other thread I linked to, by default doesn't clean up after itself.

        Regarding size you may want to look at simply creating a PAR archive for each script, the topic of reducing bloat is discussed on the par site linked to previously. See also Re: Wisdom about "packaging" or transporting Perl apps from a previous discussion on a similar topic.


Re: PAR (pp) on lots of standalone scripts
by MidLifeXis (Monsignor) on Jan 28, 2011 at 14:33 UTC

    What about something like the "outer wrapper" approach.

    mytools oldcommand params

    mytools.exe would be the par package, and the rest of the scripts could be wrapped up in a module, or scripts included in the par package or ...