Here's the quote from perdloc threads
Currently, on all platforms except MSWin32, all system calls (e.g., us
+ing system() or back-ticks) made from threads use the environment var
+iable settings from the main thread. In other words, changes made to
+%ENV in a thread will not be visible in system calls made by that thr
+ead.
To work around this, set environment variables as part of the system c
+all. For example:
my $msg = 'hello';
system("FOO=$msg; echo \$FOO"); # Outputs 'hello' to STDOUT
On MSWin32, each thread maintains its own set of environment variables
+.