XP is just a number | |
PerlMonks |
Removing subroutines from symbol tablesby Ovid (Cardinal) |
on Nov 19, 2005 at 07:08 UTC ( [id://510050]=perlquestion: print w/replies, xml ) | Need Help?? |
Ovid has asked for the wisdom of the Perl Monks concerning the following question: I'd swear I've asked this question, but since I can't find the post, here's hoping I didn't :) Basically, deleting subroutines from a symbol table seems a bit buggy, but I don't know if this behavior is documented or not.
The first time I try to remove the subroutine via undef it still leaves a CODE slot in the symbol table's *this glob. I can't just use delete because it's not an array or a hash (it fails if you try). This is bad in procedural code but it's awful in OO code because $object->can('this') will succeed even if the method has been deleted. This leaves me with having to undefine the entire glob but that's a horrible solution because the other slots in the glob, if any, are blown away. Is this a known/documented bug/feature in Perl? Is there a workaround? Cheers, New address of my CGI Course.
Back to
Seekers of Perl Wisdom
|
|