# from Eric Wilhelm
# on Thursday 25 January 2007 09:58 am:

>@INC = ('C:/Perl/lib', 'C:/Perl/site/lib'), and I had the hacked
> version in $INC[0], which pp would see, but parl would keep looking
> at $INC[1] (and also seemed to ignore $PERL5LIB.)
>
>I finally discovered that by grepping for '^#.*/PAR\.pm' in the par
> temp dir.  I still don't know why.  I believe I rebuilt parl since
> deleting the other one, so I'm not sure if it is compiled-in or what.

Ok, now I'm pretty sure it does search backwards.  I rebuilt parl with 
only the hacked PAR.pm in place (it has a 'warn "hi\n"' in it, so this 
shows up whenever it is use()d.)  Note the order of @INC, with PAR.pm 
currently in the first directory.  Note the last command, where pp sees 
the lib/PAR.pm and parl sees site/lib/PAR.pm.

--Eric
--------------------------------------------------
$ perl -MPAR -le 'print $INC{"PAR.pm"}'
hi
c:/Perl/lib/PAR.pm

$ perl -le 'print join(",", @INC)'
c:/Perl/lib,c:/Perl/site/lib,.

$ pp -o foo.exe -e 'print "hello world\n";'
hi
hi
hi

$ rm $TEMP/par-builder/* -rf; ./foo.exe \
  && grep '^#.*PAR\.pm' $TEMP/par-builder -rh
hi
hello world
#line 1 "C:/Perl/lib/PAR.pm"

$ echo 'die' > /cygdrive/c/Perl/site/lib/PAR.pm

$ pp -o foo.exe -e 'print "hello world\n";'
Set up gcc environment - 3.4.2 (mingw-special)
hi
Died at C:/Perl/site/lib/PAR.pm line 1, <_FH> chunk 1.
Compilation failed in require at -e line 688, <_FH> chunk 1.
c:\Perl\bin\pp.bat: Failed to extract a parl from 
'PAR::StrippedPARL::Static' to
 file 'parl5dKDLBt.exe' at C:/Perl/site/lib/PAR/Packer.pm line 1146, 
<DATA> line
 1.

--Eric
-- 
"If you only know how to use a hammer, every problem begins to look like
a nail."
--Richard B. Johnson
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to