in reply to undefining one slot of a typeglob
use Symbol qw( gensym ); my $old; { no strict 'refs'; $old = \*{ "package::func_name" }; } my $new = gensym; *$new = *$old{$_} foreach ( grep { defined *$old{$_} } qw( SCALAR ARRA +Y HASH IO FORMAT ) ); { no strict 'refs'; *{ "package::func_name" } = *$new; }
Edit by tye, change PRE to CODE
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: undefining one slot of a typeglob
by ysth (Canon) on Feb 24, 2004 at 15:59 UTC | |
by AidanLee (Chaplain) on Feb 24, 2004 at 16:20 UTC |