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
In reply to Re^5: How to localize conditionally? (tias)
by tye
in thread How to localize conditionally?
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |