perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [mp2 bug] Perl*Env issues
Date Wed, 15 Dec 2004 21:14:04 GMT
Pratik wrote:

> The sample configuration file which I assume to be pretty common, can
> be something like below :
> ==============================
> PerlPassEnv APP_HOME
> <Perl>
> @Include = "$ENV{APP_HOME}/conf/common.conf";
> </Perl>
> PerlPassEnv HOME
> PerlPassEnv PORT
> <Perl>
> $ServerRoot = $ENV{HOME} . "/web";
> $DocumentRoot = $ENV{HOME} . "/web/public" ;
> $Listen = $ENV{PORT};
> </Perl>

Thanks for the example, Pratik. Now it's more clear to me.

I propose the following "simple" solution:

1) Keep %ENV intact at the server startup, so anything set in the shell is 
seen from perl
2) PerlPassEnv and PerlSetEnv aren't run yet but postponed to until after 
3) just before starting workers, detach %ENV from environ, cleaning it up 
completely. now run PerlPassEnv and PerlSetEnv from (2)

That way we don't have to deal with the painful timing of PerlPassEnv and 
PerlSetEnv. We simply document that those have an affect *only* 
post-post_config phase, i.e. starting from child_init phase. If someone 
wants to modify %ENV as it's seen from shell, they can just do that with 
<Perl> sections.


So Pratiks example will become just:

@Include = "$ENV{APP_HOME}/conf/common.conf";

$ServerRoot = $ENV{HOME} . "/web";
$DocumentRoot = $ENV{HOME} . "/web/public" ;
$Listen = $ENV{PORT};

assuming that you don't need any of those ENV vars after config phase.

In fact this makes %ENV even smaller.

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

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

View raw message