No, that was deliberate. There would be no point in not using use if I did. The whole point is to defer the loading of the module until and if it is needed.
That's exactly the problem. Some of the benefits of "use"ing a module can only be observed when it is done at compile time. This is particularly important when prototypes are involved. For example, the Test::Exception module uses prototypes to allow you to use this syntax:
dies_ok {$foo->method1} 'expecting to die'; For one of my modules, I wanted to use Test::Exception in an eval so that I could skip the tests if Test::Exception was not installed. It didn't work (with the syntax shown above) until I wrapped the eval in a BEGIN block.
In reply to Re^5: When C<use Module;> *not* the same as C<require Module; import Module;>?
by itub
in thread When C<use Module;> *not* the same as C<require Module; import Module;>?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |