See ppselfdoc.PL, PAR::Environment#PAR_0, perlsyn#Plain Old Comments (Not!)

http://search.cpan.org/dist/PAR-Packer/MANIFEST
http://search.cpan.org/src/RSCHUPP/PAR-Packer-1.010/contrib/docs/where_is_it.txt
http://search.cpan.org/src/RSCHUPP/PAR-Packer-1.010/contrib/docs/who_am_i.txt

What par ends up running is %PAR_TEMP%\f5cabe72.pl

package main; shift @INC; #line 1 "script/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/__FILE__.925167.pl') } or die qq(main.pl: Can't open perl script "script/__FILE__.925 +167.pl": No such file or directory ($zip)); PAR::_run_member($member, 1);

And %PAR_TEMP%\0e790715.pl

package main; shift @INC; #line 1 "script/__FILE__.925167.pl" # works in plain perl # fails with this compilation line: # pp -P -r -v 99 -o packed.pl __FILE__.925167.pl BEGIN { use File::Spec; for (@INC) { if ( !ref $_ && -d $_ && !File::Spec->file_name_is_absolute($_ +) ) { $_ = File::Spec->rel2abs($_); } } } sub hello { my $file = __FILE__; warn "My file name is $file. Here is my contents:"; open(my $fh, "<", $file); my @data = <$fh>; warn "@data"; } hello(); 1;
Compare with %PAR_TMP%\inc\lib\strict.pm
#line 1 "strict.pm" package strict;

In an earlier par version it was

#line 1 "C:/perl/5.10.1/lib/strict.pm" package strict;

So yeah, those #line number "file" directives have gotten out of sync with reality and evolved into uselessness, as have the values in %INC  strict.pm => /loader/HASH(0xaa240c)/strict.pm

This decision isn't explained anywhere

I don't see any reason for those values not to be absolute paths, esp the %INC values


In reply to Re: __FILE__ fails in app built with PAR::Packer by Anonymous Monk
in thread __FILE__ fails in app built with PAR::Packer by metaperl

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.