in reply to Re^3: Use 'use' in foreach
in thread Use 'use' in foreach
You can, but should you? What benefit is gleaned by doing so?
Mostly performance, depending on what you do. For example, my Maplat Webserver stuff loads/configures lots of "web modules" from XML config files on startup. Each "web module" maps to one of a hundred or so perl modules (but many "web modules" use the same perl module, just with different config options on different URIs). It checks if $VERSION is defined, and if not, it loads the perl module, so it doesn't have to load them multiple times. Seems to save a bit of time on startup, which is quite handy while debugging.
My system also notifies me which perl modules are dynamically loaded (instead of already loaded with "use"), which is also quite useful in some circumstances.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Use 'use' in foreach
by stevieb (Canon) on Jul 19, 2017 at 13:23 UTC | |
by stevieb (Canon) on Jul 19, 2017 at 13:57 UTC | |
Re^5: Use 'use' in foreach
by RonW (Parson) on Jul 19, 2017 at 21:56 UTC |