http://qs321.pair.com?node_id=893103


in reply to Re^4: How to localize conditionally? (tias)
in thread How to localize conditionally?

My tests appeared to work for strange reasons. Sorry about that. But you can fix the original without copying the whole environment:

local $ENV{BLAH}; if( @ARGV ) { $ENV{BLAH}= 42; } else { delete $ENV{BLAH}; }

- tye