On Thursday, September 4, 2003, at 09:37 PM, Dave Rolsky wrote:
I'm pretty sure you have to do that. For example, if you simply set
$ENV{TZ} then localtime() doesn't change in this script:
perl -le 'print scalar localtime; $ENV{TZ} = Asia/Tokyo; print
scalar localtime'
But in this one it
On Friday, September 5, 2003, at 12:50 AM, Joshua Hoblitt wrote:
So there is a difference, on some platform(s), between inheriting the
value of TZ from the environment and setting it at runtime. Using
tzset() is the 'portable' thing to do.
Okay, thanks.
Didn't I answer an almost identical
On Fri, 5 Sep 2003, David Wheeler wrote:
Can you do another test for me (since I don't have a platform that
needs tzset)? Can you tell me how it affects use of local? Here's a
test script:
#!/usr/bin/perl -w
use strict;
use POSIX qw(tzset);
print scalar localtime, $/;
{
local
On Fri, 5 Sep 2003, David Wheeler wrote:
Bah. Thanks for that. Does this work?
#!/usr/bin/perl -w
use strict;
use POSIX qw(tzset);
print scalar localtime, $/;
{
local $ENV{TZ} = Asia/Tokyo;
tzset;
print scalar localtime, $/;
}
tzset;
print scalar localtime, $/;
yup