Instead just overwrite the CODE slot within. That prevents the GV from being
freed, which totally throws off the tokenizer, that holds a pointer to the gv
already.
This makes t/method.t and others work under the debugger, although I have no
idea why it ever worked, even with the debugger disabled.
no strict 'refs';
my ($pack, $pname) = ($name =~ m/(.+)::([^:]+)/);
push(@$temp_save, $pack->can($pname));
- delete ${"${pack}::"}{$pname};
no warnings 'redefine';
no warnings 'prototype';
*{$name} = $cr;