njcodewarrior has asked for the wisdom of the Perl Monks concerning the following question:

I've got a library of functions that I'm importing into some scripts via:

require 'path/to/myLibrary.pl';

and each function uses a number of Modules that may or may not be used by other functions within the library file.

This got me wondering:

1) Should I just import all of the modules for all of the functions at the top of the library file?
2) Should I import the modules that are used by each function within the body of the function?
3) Does it matter?

Thanks for the help.

- njcodewarrior

Replies are listed 'Best First'.
Re: Importing Modules in 'require'ed libraries
by kwaping (Priest) on Sep 07, 2006 at 22:08 UTC
    According to my research (thanks chatterbox!), it doesn't matter where they are located inside your required file. This thread might help in your understanding of use and require, like it did for me.

    ---
    It's all fine and dandy until someone has to look at the code.