Hi list,

as most of you might know and some of you have been bitten by before, a couple of @INC entries are hard-wired into perl on compilation. When shipping pp-ed binaries, these @INC entries can be a problem because the paths might exist on the target system and might contain incompatible modules.

I never really thought about the problem a lot, but the recent discussion with Marc Lehmann made me aware of a pretty simple work-around: Just grep though @INC and discard everything but the PAR hooks. (Which can be identified easily.)

Now, just adding a @INC = grep {...} @INC to the top of PAR.pm and main.pl in every pp-ed binary is a very dangerous (and wrong) thing to do since some code might rely on the old behaviour and PAR certainly shouldn't just clobber all of @INC in all cases.

Audrey liked the idea of a pp switch best. That hypothetical pp switch would result in a modification of the PAR loader code in main.pl. Additionally, I would like to introduce a very simple module PAR::Only as part of the PAR distribution which does the same thing. This is, for example, very helpful for testing to make damn sure you know the module is loaded from the .par.

My questions to you are the following:

a) Do you have any other ideas on how the problem can be solved?
b) Would you consider this a reasonable solution or would you rather not have one at all? c) Given we add a pp switch, would it be default-on (non-backwards compatible but what most users expect) or default-off (backward-compat but not the sanest default otherwise)?
d) Suggestions for the switch name (short and long)?

Thanks for your input,
Steffen

Reply via email to