where $foo goes back to normal after leaving func(), I'd like to have something likesub func { local($foo); $foo = "bar"; }
only that $self->{foo} should go back to the original value automatically after func() ends.sub func { my($self) = @_; $self->{foo} = "bar"; }
Ideas, anyone?
In reply to local() magic with hash entry? by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |