http://qs321.pair.com?node_id=251074


in reply to %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl

This is a problem on the C level, I believe. The localtime(3) call does not always check the current value of the TZ environment variable. To force it to do so, POSIX-compliant systems should use the tzset(3) call.

You can imitate this in perl via:

use POSIX; $\ = "\n"; $ENV{TZ} = "EST"; POSIX::tzset(); print scalar localtime(); $ENV{TZ} = "DST"; POSIX::tzset(); print scalar localtime();

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Replies are listed 'Best First'.
Re: Re: %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl
by dtr (Scribe) on Jul 23, 2003 at 17:08 UTC
    This works fine from a script, but does not work under mod_perl_2! Do you have any suggestions as to how I might go about getting this working under mod_perl_2?????