If you make the changes within a scope, you can localize them such that they'll be automagically undone when the scope exits.
sub foo { print "foo\n" } { local *foo = sub { print "bar\n" }; foo(); } foo(); __END__ bar foo
In reply to Re: undefining one slot of a typeglob
by dws
in thread undefining one slot of a typeglob
by AidanLee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |