#!/usr/bin/perl use strict; use warnings; use threads; use POSIX qw(tzset); my $t=localtime(); print "local time: ",$t,"\n"; my ($tr) = threads->create(\&thr_proc); $tr->join; $ENV{TZ}="Europe/Paris"; $t=localtime(); print "main: ",$t,"\n"; $ENV{TZ}="Europe/Moscow"; $t=localtime(); print "main: ",$t,"\n"; sub thr_proc { $ENV{TZ} = 'Europe/Paris'; $t = localtime; print "in thread: ",$t,"\n"; $ENV{TZ} = 'Europe/Moscow'; $t = localtime; print "in thread: ",$t,"\n"; }