well, i am not afforded the luxury of limiting the scope of my symbol table manipulations, and for some reason, doing an undef &$foo works in that it destroys the subroutine, but UNIVERSAL::can($package,$method) still returns true, so something wasn't complete there. However, I now have code that does what i need and passes my tests:
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