perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [PATCH] add PERL5LIB to @INC in the correct order
Date Mon, 06 Oct 2003 18:27:00 GMT
Simon Flack wrote:
> On Tue, 30 Sep 2003 11:49:57 -0700, Stas Bekman wrote
>>Simon Flack wrote:
>>>  at the beggining of each request PERL5LIB is prepended to @INC in
>>>  reverse order. E.g.:
>>>     SetEnv PERL5LIB "one:two:three:four"
>>>  results in this:
>>>     @INC = ('four', 'three', 'two', 'one', '/usr....', '...');
>>>  Tested with perl 5.6.1, mod_perl 1.27 and 1.28
>>>A patch is attached to src/modules/perl/perl_util.c that adds the 
>>>variables in the correct order.
>>Thank you Simon.
>>It's a bug indeed. However I think we can't change this 
>>functionality in mp1 at this point, since it'll break other people's 
>>setups which rely on the current behavior. We probably should 
>>document this mis-feature.
> Stas,
> That's fine. Although the behaviour has changed as recently as v1.27 where 
> previously the contents of PERL5LIB were pushed onto @INC rather that 
> unshifted.

Well, the fix in 1.27 was different:

PERL5LIB support now properly unshifts paths into @INC rather than push
[Tatsuhiko Miyagawa <>]

before 1.27, PERL5LIB was getting appended to @INC, instead of being 
prepended. As a side effect it got the values in PERL5LIB reversed, but at 
least they are coming in before the hardcoded @INC.

> The problem with the current behaviour is that you need a special case when 
> running under mod_perl. In our set up, we test our scripts as CGIs and with 
> Apache::Registry and it's nice to be able to set PERL5LIB in one place rather 
> than two.

On the second thought, chances are that nobody has been using a multiple-paths 
PERL5LIB, otherwise they would have complained like you did. So if nobody 
objects and we agree that the current behavior is buggy, +1 for your patch.

So what do you think, fix it? or document it?

and of course need to fix that in mp2.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message