Fellow monks,

I just ran into a path problem with PAR. I have a program which is delivered as a PAR executable. My program refers to some additional file which is packaged up into the executable with pp --output=executable --addfile=myfile myprog.pl. When my program runs, I need to run that additional file (myfile) via qx(). However, before I can do that, I need to chmod that file, and in order to do that, I need to get the full path to this file. Is there a PAR variable or method which will let me get the path to my file?

Many thanks, Hoping for a prompt response, because this is scheduled to ship in the next few hours :-)

Update I think I found that $ENV{PAR_TEMP} contains the path to par cache. However, I now seem to have an entirely different, albeit very strange problem. It seems that if I run my par'ed up program from the directory where the file resides, I get one cache directory, and if I run my program from any other directory (my program is in my $PATH) then I get a different cache directory. Even stranger is that my additional file is only in the first cache directory and not the second! Is this a bug in PAR or am I missing something?


In reply to PAR cache path by gri6507

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.