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 $ENV{TZ} = "Asia/Tokyo";
>      tzset;
>      print scalar localtime, $/;
> }
> print scalar localtime, $/;
>
> The question is, what does the third print statement print? Do I need
> to call tzset again after the block?

Yep, you need to call it again.  Whatever tzset does is something at a C
library level, not a Perl level, so the localization doesn't do anything.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to