On Tue, 19 Oct 1999, Mark Cogan wrote:

> >> On Tuesday, October 19, 1999 4:13 AM, William Deegan
> [SMTP:[EMAIL PROTECTED]] wrote:
> >> > How can I change the environment variables that get passed to a perl
> >> > script running under Apache::Registry from a PerlTransHandler?
> >> >
> >> > I'm using the PerlTransHandler to do a sort of dynamic mod_rewrite
> >> > functionality.

[...]

> Use the %ENV hash in perl. The environment is shared between the whole
> request, so setting $ENV{whatever} in the PerlTransHandler will make it
> visible to the content handler down the line. 

I'd suggest using $r->subprocess_env() instead.

We have a somewhat similar situation where we have a PerlTransHandler
that sets certain environment variables that CGI scripts depend on
(yes, plain mod_cgi while we have mod_perl -- but that's another story).

I guess %ENV will work in many situations, but it might bite you later
when you can't figure out why a particular env variable isn't getting set
in certain situations (speaking from experience).

See the explanation on pages 454-455 in the Eagle book.

Reply via email to