in reply to Removing subroutines from symbol tables
That doesn’t surprise me at all. It’s a feature, not a bug: the same behaviour makes sub foo; predeclarations work, as well as things like
my $x = \&foo; *foo = sub { 'yep' }; print $x->(), "\n"; __END__ yep
The only solution for what you want that I can think of is to save all the slots from the glob, then blow it away, and finally restore the other slots.
Makeshifts last the longest.
|
|---|