If you're using a perl compiled with thread support, you'll need to call POSIX::tzset() after setting $ENV{TZ}.
 


From: Tyler [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 2:09 PM
To: modperl@perl.apache.org
Subject: Using ENV{'TZ'} in mod_perl

Hello,


I have a script that use to use the value in the environment variable ENV{‘TZ’} to modify the output of the perl builtin localtime.  In other words, I’d do something like this:

 

$ENV{‘TZ’} = ‘US/Eastern’;

@time = localtime();

 

This use to give me the localtime in whatever timezone was in ENV{‘TZ’}.  However, I have since then switched to using mod_perl (more specifically the PerlRun module) and now this code no longer works (i.e. $ENV{‘TZ’} doesn’t have any affect on localtime).  I’ve tried various modifications to my mod_perl install (such as configuring PerlPassEnv, etc) but still can’t get it to work. 

 

Does anyone have any recommendations, or thoughts?

 

Thank you in advance,

Tyler Fullerton.

 

Reply via email to