From: Florian Ragwitz Date: Thu, 23 Oct 2008 21:54:03 +0000 (+0000) Subject: Don't delete the previous symbol table entry when shadowing subs. X-Git-Tag: 0.005000~52 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=252e815441bd31bc1a310337dc8177ab9ae4cd51;p=p5sagit%2FDevel-Declare.git Don't delete the previous symbol table entry when shadowing subs. 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. --- diff --git a/lib/Devel/Declare.pm b/lib/Devel/Declare.pm index 227b3ba..a3e76bf 100644 --- a/lib/Devel/Declare.pm +++ b/lib/Devel/Declare.pm @@ -97,7 +97,6 @@ sub shadow_sub { 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;