Inspired by adamk at last YAPC::Europe, I'm trying to do an "evil" experiment. I want to change the required module names on the fly. Suppose that I have:
Ok. Now, what I want is to add my own pragma. And if I do this, I want My::Module to be replaced with Another::Module. Something like:
# Here this should really load 'Another/Module.pm',
# possibly using my_evil_pragma::replace_name($mod)
I originally tried with use, but I don't remember why I fell back on require. Anyway, it looks like I can't find a way to properly override CORE::GLOBAL::require to do what I want.
Or, is there some other way to achieve this?
... and no, it's not production code, only some experiment ...