On Tue, Mar 22, 2011 at 7:34 PM, Travis Williams <[email protected]> wrote: > Is there a way to make pp check if the script it is compiling (converting, > transforming to a .exe, etc,etc) actually has all the modules required to > run that script? I have a few different dev enviroments and and a shared > repository and I find myself loading a module on system A for testing, then > ending up on system B to compile it, and B doesn't have that module.
Use pp's option "-c". This will run "perl -c your_script" before packing, so should prevent glaring omissions: $ pp -o foo.exe -e 'use Frobozz;' # packs without complaint (and Frobozz.pm :) $ pp -o foo.exe -c -e 'use Frobozz;' Can't locate Frobozz.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.12.3 /usr/local/share/perl/5.12.3 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl .) at 8JEx3Q line 4. BEGIN failed--compilation aborted at 8JEx3Q line 4. SYSTEM ERROR in compiling pppgE1t.pl: 512 at /usr/share/perl5/Module/ScanDeps.pm If you have modules that are loaded dynamically at runtime then "-c" won't catch if they're missing. There's also "-x" which actually _runs_ your script once before packing it. But that might not work for every script: $ pp -o foo.exe -x -e 'die "cant pp this with -x" unless @ARGV;' cant pp this with -x at /var/tmp/build/yef3ra line 2. SYSTEM ERROR in executing pplZkVW.pl: 65280 at /usr/share/perl5/Module/ScanDeps.pm line 1289 Cheers, Roderich
