BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
According to perlfunc, use Module;
[] is exactly equivalent to
BEGIN { require Module; import Module LIST; }
except that Module must be a bareword.
I've tried this on several occasions with several different standard/core modules, and it isn't!
When I use these modules, they export, by default, some subset of their potential exports, which for the simple case is exactly what I want.
When I have need to defer the loading of a module until (and if) it is required--with require--I would like to not have to work out which set of things I going to have to import individually, or even which :tag will give me the default set.
If perlfunc was correct, then calling import Module; would do that, but it often (usually?) doesn't.
Without getting into the specifics of any particular module, is it possible to explain why this is so, and what can be done about it?
|
|---|