We don't bite newbies here... much | |
PerlMonks |
Re^4: use 'local' modifier to hashref elementby Anonymous Monk |
on Jun 05, 2013 at 21:00 UTC ( [id://1037303]=note: print w/replies, xml ) | Need Help?? |
Test it. It works. It is more reliable than manually restoring code because you don't have redundant code to mess up on, and because you don't have to worry about exceptions skipping that code.
I've been using the trick since Perl 5.005.
The ONLY type of scalar that you can't use local on is one defined with my. And that was rejected not because it was hard - it is easy - but because Larry Wall thought that it would confuse people to allow that.
In Section
Seekers of Perl Wisdom
|
|