I’ve written a special import function that will be used in a few places and I’d like to be able to just go “use ImportRenamer;” in those modules and have them use the import gained from ImportRenamer henceforth. How would i go about that?
Edit: In other words: How do i import ‘import’ without running it?
UPDATE
Now that OP clarified his needs, this should indeed be done in a way similar to what Exported does, to be precise, by injecting the sub reference into a caller’s namespace via a glob assignment. Example:
And the test:
ORIGINAL ANSWER
You don’t need to do anything special beyond calling the import method “
import“.usealready callsimport(), see perldoc use: