Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by Chmrr (Vicar)
on Apr 16, 2003 at 22:35 UTC ( [id://251074]=note: print w/replies, xml ) Need Help??


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?????

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://251074]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found