saintmike has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: local() magic with hash entry?
by diotalevi (Canon) on Jul 07, 2006 at 23:26 UTC | |
by saintmike (Vicar) on Jul 07, 2006 at 23:42 UTC | |
by tinita (Parson) on Jul 09, 2006 at 13:00 UTC | |
by Hue-Bond (Priest) on Jul 09, 2006 at 13:09 UTC |