Subject: | Cover doesnt like some Symbole Table modifications |
the following code installs a wrapper around the original sub s1, by making a copy, of the current code pointer, and changing the symbol table:
sub s1 {
my $t = shift;
if ($t > 5) {print 5 }
else {print $t }
}
my $c = *main::s1{CODE};
*main::s1 = sub {
print "extra";
&$c(@_);
};
s1(1);
s1(7);
running this under cover, will show the coverage of the new code, but not of the original code.
The same applies, if the reference to the original code is captured with "$c = \&s1;", As Devel::Leak::Object does.
No Idea, if this is solvable, but it would be great if.
Many thanks
Martin