in reply to Re^2: Problem running IPTraf from Perl
in thread Problem running IPTraf from Perl

True, the environment only propagates down the process tree. But any process spawned by the script will see the changed environment, and these changes might be unexpected by other parts of the program. TERM might not be a problem, but others like PATH, LD_PRELOAD, or something else might well be.

I like to make global changes, not only the environment but every global perl variable, as local as possible.

print `echo %TERM%`; $ENV{TERM} = 'vt220'; # In some code, far, far away... print `echo %TERM%`;
C:\tmp>perl t.pl %TERM% vt220