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.
Comment on Re^4: use 'local' modifier to hashref element