On Jan 17, 2008 4:14 PM, Bart Schaefer <[EMAIL PROTECTED]> wrote: > There's a thread from December that would seem to be related. From that > thread: > > ---------- Forwarded message ---------- > From: Michael Schout <[EMAIL PROTECTED]> > Date: Dec 28, 2007 9:12 PM > Subject: Re: mod_perl, ENV{'TZ'}, and localtime > To: Kirk Noda <[EMAIL PROTECTED]> > Cc: modperl@perl.apache.org > > > Kirk Noda wrote: > The reason this does not work under modperl version 2.0 is because under > handler "perl-script", %ENV is untied from the C environment. The > localtime() function is implemented in C, and as a result, it will never > see the changes you made to $ENV{TZ} from mod_perl. > > The way I got around this was to use Env::C, and override > CORE::localtime() with something like: >... > Regards, > Michael Schout
Hmm... this is a bit beyond what I wanted to do, not sure of all the implications of the above. Does this mean I need to do a Env::C::setenv('PATH', $ENV{PATH}, 1); in my script? In any case, given the results, looks like I should report a [bug], not necessarily in mod_perl code, but in the docs, which seem to suggest that the docs could be clarified that changes to %ENV won't really do what may be expected? >From: 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. If anyone has other options to recommend, let me know, will try to look into other (non-mod-perl) to get a speedier CGI execution of perl scripts (for a small web site).