First do a survey of what are the contents of the packed archive. Most likely the vast majority are binary libraries which perl depends on. Logically, in this case, your best option is to install a complete Perl in your target system, if you can. Additional benefit is that these libraries can be reused instead of each packed archive using their own.

You can install Perl and modules in your target system but still have your program packed and run by PAR which will not include any Perl dependencies. This will result in a much smaller archive, hence faster extraction. See Perl-interpreter-only,-without-core-modules: of pp and Perl-with-PAR.pm-and-its-dependencies-installed: of pp. In this way you have the best of both worlds, (1) Perl installed in your target system once, and (2) you can distribute your program(s) as single executables of very small size as many times as you like.

If you want to extract once and use forever, then you can use saner filenames with -T or --tempcache (see -T,-tempcache of pp) to specify something else instead of an ugly hash. Most importantly, you can change the first part of the extract-to directory (i.e. the /tmp/...). See PAR::Environment and PAR_GLOBAL_TEMP etc.

If you are in Linux, you can extract into a temporary RAM-based dir: as root, mount -t tmpfs -o size=500m tmpfs /myramdir and then set PAR_GLOBAL_TEMP to /myramdir. Your program will live there until reboot or unmount. That will be faster though ephemeral.

Also, there is the option of running perl through a docker linux container. Theoretically talking, your container should include perl and all module dependencies. Your program can be inside or outside the container.


In reply to Re: pp's tmp folder content execution by bliako
in thread pp's tmp folder content execution by DomX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.