As long as a module or library doesn't "compute" what else it needs to load at run time, it is possible to statically inspect each module and library loaded to find what they load. Then scan all those and so on, until you run out of "new" modules and libraries.

As I understand it, the scanner used by PAR::Packer only scans Perl modules. If the libraries loaded by any of these modules load further libraries (and maybe even modules), it won't see them. So, pp has the -c and -x options to help.

-c tells it to compile the input. This runs each module's setup code, as well as any BEGIN, UNITCHECK and CHECK blocks (see BEGIN). This updates information in the Perl environment that the scanner can inspect for more libraries and modules.

-x actually runs the inputs, but without parameters or options1. This might find even more then -c, but some programs might not work properly when run this way.

YMMV applies.

1 In the past, I've had problems with programs that, correctly, exit with a non-zero status when run with no parameters or options. I and others have requested either a way to specify parameters/options or to otherwise detect when being run by the PAR::Packer scanner. Maybe this will happen.

Update: Or to add an option to ignore the program's exit status.

In the meantime, possible work-arounds include do a test run with a modified version of your program, or "enhance" your program to check for a value in an environment variable you set before running pp/PAR::Packer (actually, the ability to accept options through an environment variable may, in some cases, be a desirable feature)


In reply to Re^2: Convertion Perl Script to Exe with PAR::Packer pp by RonW
in thread Convertion Perl Script to Exe with PAR::Packer pp by marchiore

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.