If I may add my grain of salt as an -interested- user for this one...

Here's how I would expect PERL5LIB to work :

1) Ability to set it in httpd.conf      on a per server, vhost,
directory or location basis.
2) Ability to set it on a per request basis as well (via SetEnvIf or
mod_rewrite)


Where would this be useful?  Especially in DEVELOPMENT/TEST
environments. 

Somebody might be working on (read : breaking into pieces) some module
which is "used" by several mod_perl/CGI scripts. The stuff needs to be
tested before it can even become part of the "development environment"
where others work on different parts of the project and count on modules
"working correctly".  

If the above were supported, I could set up an alternate location/
ScriptAlias for the CGI scripts where the PERL5LIB points to a set of
modules to be tested , and do the dirtiest of things without impacting
my co-workers.

The reason I prefer PERL5LIB over PerlSwitches, besides it being more
familiar, is that it is more flexible : there are 50 million ways to set
up an environment variable.

Right now, the only way we have is to set up a different vhost to get
this kind of thing working.

If I am guessing correctly, if mod_perl was to support this kind of
behaviour, it would mean mingling with @INC on every request, or at
least checking if it would need to be mingled.  This may not be very
cheap in terms of overhead. 

Besides, it might be quite a headache to implement because of how the
"use/require" mechanism works. That is, the %INC hash would need to be
invalidated whenever @INC would change. This is all expensive stuff.


So, my suggestion is to have a switch (on a vhost or interpreter pool
basis) that would control the way PERL5LIB is handled. Much like the
"reload" switch. It could be "normally off" so that it doesn't cause
much of an overhead on the production. It could also require that
setup-environment be "on" for it to work. 


As a last word  : if it can't work as it should, I think it's better to
turn the behaviour off until it can, so that people don't rely on it
behaving incorrectly.


Cheers,

Ayhan


-----Message d'origine-----
De�: Geoffrey Young [mailto:[EMAIL PROTECTED] 
Envoy�: vendredi 17 octobre 2003 01:56
��: Stas Bekman
Cc�: [EMAIL PROTECTED]
Objet�: Re: [PATCH] add PERL5LIB to @INC in the correct order


> OK, I'm convinced on this one. We should add a new entry to 
> porting/compat.pod then, including you summary above. Should I do
that, 
> or will you handle that.

I'll put it on my ToDo.

> 
> I still want to know why PERL5LIB is ignored by perl, I will ask p5p
as 
> perlsec.pod doesn't say anything about it.

yeah, me too.

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to