Yes, by switching from use to require and
import, you are reducing start-up time and probably reducing
memory utilization (unless those modules are getting required
elsewhere) until that chunk of code actually gets run.
The only thing you are losing is that the import doesn't
happen until run time so any imported subroutines are not predeclared
before the code that uses them is compiled. The practical consequences
of this are that
- you'll need to use parens to invoke the functions and
- for any functions with prototypes, the prototypes will
not be in effect for your code.
For most modules, those two consequence are pretty minor.
-
tye
(but my friends call me "Tye")