Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 283509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:22:46+00:00 2026-05-12T05:22:46+00:00

This is my attempt to cut through extraneous issues raised Why don’t my system

  • 0

This is my attempt to cut through extraneous issues raised “Why don’t my system calls work in the Perl program I wrap with pp?” I have created a simple Perl script on a linux system:

new-net:~/scripts # cat ls_test.pl
@ls_out = `ls -l`;

map { print "$_\n" } @ls_out;

$out = `sh out_test.sh`;

print "$out\n";

This script calls a simple shell file:

new-net:~/scripts # cat out_test.sh
echo "I'm here"

I used pp to pack the Perl script along with the shell script into ls_test:

new-net:~/test # unzip -l ls_test
Archive:  ls_test
  Length     Date   Time    Name
 --------    ----   ----    ----
        0  07-13-09 16:41   script/
      436  07-13-09 16:41   MANIFEST
      214  07-13-09 16:41   META.yml
       93  07-13-09 16:41   script/ls_test.pl
      538  07-13-09 16:41   script/main.pl
       16  07-13-09 16:20   out_test.sh
 --------                   -------
     1297                   6 files

If I run the packed file in an otherwise empty directory, the shell script is not found:

new-net:~/test # ./ls_test
total 3391

-rwxr-xr-x 1 root root 3466177 Jul 13 16:41 ls_test

sh: out_test.sh: No such file or directory

If I copy the shell script into the directory, the packed script runs as expected:

new-net:~/test # ./ls_test
total 3395 -rwxr-xr-x 1 root root 3466177 Jul 13 16:41 ls_test -rw-r--r-- 1 root root 16 Jul 13 16:20 out_test.sh I'm here

So, where does a pp packed script expect to find an included file? And how should a call to that included file be configured in the original Perl script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:22:47+00:00Added an answer on May 12, 2026 at 5:22 am

    The files in a packaged executable are extracted to a temporary directory (usually /tmp/par-USERNAME/cache-XXXXXXX).
    To access these files do something like the following:

    #!/usr/bin/perl
    
    # Reads a data file from the archive (added with -a)
    print PAR::read_file("data");
    
    # Will execute "script2" in the archive and exit. Will not return to this script.
    require PAR;
    PAR->import( { file => $0, run => 'script2' } );
    

    You can also make symolic links to the executable that have the same name as the script you want to run, and run those.

    Actually, rereading your question, simply accessing the PAR_TEMP environment variable is probably more useful:

    #!/usr/bin/perl
    use File::Slurp qw(slurp);
    
    $data_dir = "$ENV{PAR_TEMP}/inc";
    $script_dir = "$data_dir/script";
    
    print slurp("$data_dir/datafile");
    
    # file access permissions are not preserved as far as I can tell,
    # so you'll have to invoke the interpreter explicitly.
    system 'perl', "$script_dir/script2", @args;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is an attempt to rephrase a question I asked earlier. I'd like to
This is a pretty straight forward attempt. I haven't been using python for too
THis is a followup to my previous question Font-dependent control positioning. It's an attempt
If you were going to attempt this, what would be the main factors to
I have found this example on StackOverflow: var people = new List<Person> { new
How can I use boost::filesystem::path to specify a relative path on Windows? This attempt
I want to have a dialog that looks kinda like this: I thought this
I get an Uncaught TypeError: Illegal invocation for both versions of this attempt to
This is a bit of a long shot, but if anyone can figure it
This is starting to vex me. I recently decided to clear out my FTP,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.