It works on both my OpenBSD and Linux perl 5.6.1 and 5.00503. What platform are you testing on?
{
local $\ = "\n";
print scalar localtime;
{
local $ENV{TZ} = 'GMT';
print scalar localtime;
}
print scalar localtime, ", which is right.";
}
Thu May 30 16:36:26 2002
Thu May 30 21:36:26 2002
Thu May 30 16:36:26 2002, which is right.