in reply to Can I auto-save and restore global variables?
Hi,
have a look at perldoc -f local. I'm not sure whether you want the following:
use Data::Dumper; $Data::Dumper::blah = 0; # Set defaults $Data::Dumper::fred = 'xyz'; ... if ($i_am_debugging_this_bit) { local $Data::Dumper::blah = 1; # Override these for a bit local $Data::Dumper::fred = 'nerd'; ... }
This should do what you want.
Regards
McA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can I auto-save and restore global variables?
by davehorsfall (Novice) on Jul 25, 2014 at 04:54 UTC |