Problems? Is your data what you think it is? | |
PerlMonks |
Re^2: Convertion Perl Script to Exe with PAR::Packer ppby RonW (Parson) |
on Jul 24, 2014 at 23:21 UTC ( [id://1094968]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|