in reply to monkey patching an entire module
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.
|
---|