sub fred { print "FRED>> @_\n" ; } @fred = qw(a b c) ; fred() ; print "ARRAY: @fred\n" ; my $can = __PACKAGE__->can('fred') ; print "can1: $can\n" ; undef_sub('fred') ; my $can = __PACKAGE__->can('fred') ; print "can2: $can\n" ; print "ARRAY: @fred\n" ; sub undef_sub { my $sub = shift ; my $s = *{$sub}{SCALAR} ; my $a = *{$sub}{ARRAY} ; my $h = *{$sub}{HASH} ; undef *{$sub} ; *{$sub} = $s ; *{$sub} = $a ; *{$sub} = $h ; }