Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: pp and multiple perl scripts

by Anonymous Monk
on Mar 06, 2012 at 18:06 UTC ( #958131=note: print w/replies, xml ) Need Help??

in reply to pp and multiple perl scripts

Forget about PAR, its for the brave, use Pack multiple scripts in executables with one shared core dll


Replies are listed 'Best First'.
Re^2: pp and multiple perl scripts
by Dirk80 (Monk) on Mar 07, 2012 at 21:12 UTC

    Thanks for your post. I'll give the cava packager a try.

    But fortunately I found a solution to this pp challenge myself.

    1. Create par consisting of main_script and its helper scripts with all their dependencies:

      pp -p -o perl_app.par
    2. Open perl_app.par with an archive program and add to the /script folder a file.

      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/') } or die qq( Can't open perl script "script/main_script. +pl": No such file or directory ($zip)); PAR::_run_member($member, 1);
    3. Create perl_app.exe as follows:

      pp -o perl_app.exe perl_app.par

    In the main_script you can then call the helper_scripts as follows (example with

    my $cmd; if ( defined $ENV{PAR_TEMP} ) { $cmd = "perl $ENV{PAR_TEMP}/inc/script/"; } else { $cmd = "perl"; } # execute cmd
      Did you try that without an installed perl?

        No, I didn't try it without an installed Perl. You are right. I'll try this evening and post you if it worked.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://958131]
[stevieb]: I am thankful that I fell into Perl years ago in the manner I did. I don't believe there is another language that people care about so much, that they're willing to give everything. Langs come and go, but in Perl, it seems, things remain consistent.
[stevieb]: The people back then (~2000) are the same people now, but with much more experience. I'm appreciative that I fell into the Perl rabbit hole.
[stevieb]: Coding circles around Python devs, showing how unit tests should be done, enabling easy access to everything, learning basic C to wrap for direct hardware access... I am thankful.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2017-02-25 01:22 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (364 votes). Check out past polls.