>>>>> "MW" == Martin Wood <[EMAIL PROTECTED]> writes:
MW> Our Apache::Registry CGIs need access to a dozen or so core modules - is
MW> there an elegant solution to loading these without seeing a dozen or so use
MW> statements at the head of the script? (We have over 100 different CGIs that
The "use" statement does two things: 1) it loads the module if not
already done and 2) it calls import() on the module to import any
symbols into the current name space.
If you add a "standard" module to your set, how will it affect
existing apps if they don't directly need it or call it? Why have the
"use" statement at all if that particular module is not being used?
You really do want to pre-load the code for the modules using either
PerlRequire or a startup script. I prefer the latter.
You still need the "use" statement in each program that expects the
module so that the import() gets done. If you know there is nothing
to be imported, you can get away without the "use" but then you lose
out in the self-documenting nature of the modules that this particular
program requires to run.
In short, you should leave the "use" calls in place on every script.
Don't have "use" for modules you are not using. Pre-load your modules
using a startup script.
Reading the mod_perl guide is also a good thing to do to learn about
optimizing memory usage (as is the tuning guide that comes with
mod_perl.)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996
GPG & MIME spoken here http://www.khera.org/~vivek/