in reply to Re^2: Altering Package Subs and Running In To Problems
in thread Altering Package Subs and Running In To Problems
I tested and doing it in INIT works as you'd expect:
import is called when the module is used, thereby replacing
the function before the base one being replaced is defined.
So the base ends up replacing the plug-in. But INIT
is called right before execution so it does the job.
Regarding the evilness of this: Playing around like this is
one of the ways I learned how Perl works. You will no doubt
experience several lightbulbs going on as try different
approaches, which is a good thing. Just think about your
clients, the interfaces they use, and how much you may be
bending standard views of the world before you turn what
you play with into production code.