One addendum to the existing answers. If you are running under mod_perl you will wants to 'use' all your modules during server startup rather than loading them as needed.
The reason is that modules loaded before Apache forks off children will usually share a lot of the memory they use between the various child processes. If you require the module at run time, you will load a _full_ copy into every child that uses it.
Unless those modules are used _extremely_ rarely, its generally going to be a memory loss under mod_perl.
Of course, there is a nice clarity to being able to look at the top of a script/module and see all the modules it uses. Also, if a module isn't there, its nicer to get a compile time error rather a runtime error halfway through execution.
Your approach is probably fine but I wouldn't want to do that myself unless I saw a really big impact.
-dave
|