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

I have perl v5.8.0 built for i686-linux-thread-multi-ld and doing
perl -e '$ENV{TZ} = "DST";print scalar localtime(), "\n";'
works fine for me.
  • Comment on Re: %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl
  • Download Code

Replies are listed 'Best First'.
Re: Re: %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl
by dda (Friar) on Apr 16, 2003 at 20:31 UTC
    Could you please try this:
    perl -e '$ENV{TZ} = "EST";print scalar localtime(), "\n";$ENV{TZ} = "DST";print scalar localtime(), "\n";'
    It works correctly at 5.6.1 and misbehaves at 5.8.0

    --dda

      What dda means to say is:

      here is the output on a redhat 8, perl 5.8.0 (multithreaded) box (actually we have tried 3 redhat 8 boxes):

      perl -e '$ENV{TZ} = "EST";print scalar localtime(), "\n";$ENV{TZ} = "DST";print scalar localtime(), "\n";'
      Wed Apr 16 15:47:41 2003
      Wed Apr 16 15:47:41 2003


      whereas on a redhat 7.2, perl 5.6.1 box, the output is
      Wed Apr 16 15:42:25 2003
      Wed Apr 16 20:42:25 2003


      and on a freebsd box, perl 5.8.0, the output is also correct, i.e.
      Wed Apr 16 15:42:25 2003
      Wed Apr 16 20:42:25 2003

      perl 5.6.1 under cygwin seems to manifest the problem also.
      Hmmmm, I see what you mean. Seems like a bug (like you said).

      Just to let every know, output is:

      Wed Apr 16 15:56:22 2003 Wed Apr 16 15:56:22 2003