The docs seem to suggest that that changes to %ENV should work fine:
  http://perl.apache.org/docs/2.0/user/coding/coding.html
mod_perl passes (exports) the following shell environment variables
(if they are set) :
  *      PATH - Executables search path.
  *      TZ - Time Zone.
Any of these environment variables can be accessed via %ENV

You can *access* them, but if you change them, they will not be synchronized with the C environment. You have to use Env::C to work around that. MP2 unties the perl %ENV hash from the C environment during the request, so any changes you make to %ENV during the request will never be seen by anything written in C unless you manually copy it over with something like Env::C.

IMO, it would be a lot easier if we could make the "untie %ENV" behavior optional with a PerlSwitches configuration directive or something. If you are running a non-threaded perl on a prefork MPM, I really do not see the harm in leaving %ENV tied to the C environment. Maybe I'll try to whip up a patch if I can figure it out :).

Regards,
Michael Schout

Reply via email to