in reply to change perl function in runtime
You need *globs to manipulate symbol table entries like package functions! ( see perlmod and perlsub)
Something like this should do
{ package A; local *x = sub { die "aaa" }; #run tests ... } # &x reset after leaving block
if you want to explicitly reset &x try to store the old coderef before.
$old_coderef = \&x; # run tests ... # do what you want ... # (but think about the omen ;-) *x = $old_coderef;
Cheers Rolf
In Section
Seekers of Perl Wisdom