Pathologically Eclectic Rubbish Lister | |
PerlMonks |
monkey patching an entire moduleby perl5ever (Pilgrim) |
on Apr 21, 2009 at 15:01 UTC ( [id://759011]=perlquestion: print w/replies, xml ) | Need Help?? |
perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
Using local() it's easy to monkey patch a variable, and here is a way of monkey patching a method of a particular instance.
Suppose you want to monkey patch an entire module? What's the best way to go about it? There will be two cases: one where the module has not been loaded yet and the case where it has been. And, to be most useful, you'd want the patching to be reversible.
Back to
Seekers of Perl Wisdom
|
|