in reply to Re: pp and multiple perl scripts
in thread pp and multiple perl scripts
Thanks for your post. I'll give the cava packager a try.
But fortunately I found a solution to this pp challenge myself.
Create par consisting of main_script and its helper scripts with all their dependencies:
pp -p -o perl_app.par main_script.pl helper_script1.pl helper_script2.plOpen perl_app.par with an archive program and add to the /script folder a main.pl file.
main.pl:
if (defined $ENV{PAR_APP_REUSE}) { warn "Executable was created without the --reusable option. See 'p +erldoc pp'.\n"; exit(1); } my $zip = $PAR::LibCache{$ENV{PAR_PROGNAME}} || Archive::Zip->new(__FI +LE__); my $member = eval { $zip->memberNamed('script/main_script.pl') } or die qq(main.pl: Can't open perl script "script/main_script. +pl": No such file or directory ($zip)); PAR::_run_member($member, 1);
Create perl_app.exe as follows:
pp -o perl_app.exe perl_app.parIn the main_script you can then call the helper_scripts as follows (example with helper_script1.pl):
my $cmd; if ( defined $ENV{PAR_TEMP} ) { $cmd = "perl $ENV{PAR_TEMP}/inc/script/helper_script1.pl"; } else { $cmd = "perl helper_script1.pl"; } # execute cmd
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: pp and multiple perl scripts
by Anonymous Monk on Mar 08, 2012 at 02:54 UTC | |
by Dirk80 (Pilgrim) on Mar 08, 2012 at 08:03 UTC | |
by Dirk80 (Pilgrim) on Mar 08, 2012 at 21:44 UTC | |
by Anonymous Monk on Mar 09, 2012 at 12:06 UTC | |
by Dirk80 (Pilgrim) on Mar 14, 2012 at 22:11 UTC | |
|