Fri Jan 23 18:40:40 2009: Request 42731 was acted upon.
Transaction: Correspondence added by SMUELLER
Queue: PAR-Packer
Subject: pp Breaks @INC
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: [email protected]
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42731 >
Hi,
thanks for the bug report, but the behaviour you describe is on purpose.
When you use pp to produce a stand-alone binary executable, it clears
the INC paths of your perl. That is on purpose so *if* it breaks, it
will break on your development machine already. Otherwise you might be
relying on local stuff that is not present on the target machines.
If you modify @INC at run-time, the paths will be preserved.
This behaviour is documented in the pp help. Quoting the relevant synopsis:
% pp -B -p -o out.par file # same as above, but bundles core modules
# and removes any local paths from @INC
% pp -P -o out.pl file # Creates 'out.pl' from 'file'
% pp -B -p -o out.pl file # same as above, but bundles core modules
# and removes any local paths from @INC
# (-B is assumed when making executables)
"Since PAR version 0.953, this also strips any local paths from the
list of module search paths C<@INC> before running the contained
script."
It *is* possible to override this behaviour (modify/replace main.pl in
the par file), but I would strongly discourage this. Step back and think
about whether you really want your executable to be dependent on the
perl it was built with.
Either way, this is not a bug but intended so I will close the ticket.
For further discussion or assistance, please send any correspondence to
the PAR mailing list directly.
Thanks and best regards,
Steffen