A simple trick that should work for the common usage: Make a sub named "My::Module" that returns either the string "Monkeypatch::My::Module" or "My::Module".
You'll have to declare the sub before the first instance of "My::Module" is compiled.
Ah dang, it won't work if someone inherits from the class. Ah well, I'll post it anyway in case it helps.
In reply to Re: monkey patching an entire module
by ikegami
in thread monkey patching an entire module
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |