in reply to Changing ENV values locally

Try
print "$ENV{'TERM'}\n"; { local $ENV{'TERM'} = "foo"; print "$ENV{'TERM'}\n"; } print "$ENV{'TERM'}\n";