in reply to Mods in different directories

"push" the module directory names to the @INC array in the beginning of your script. Alternatively if you want it to search your directories before the ones below use "unshift" instead of "push"

The @INC Variable

The @INC array variable contains a list of directories to be searched for files requested by the require function. This list consists of the following items, in order from first to last:

- The directories specified by the -I option
- The Perl library directory, which is normally /usr/local/bin/perl
- The current working directory (represented by the . character)

Like any array variable, @INC can be added to or modified.

Dean

PS. I should add that the @INC array is a system variable.

Replies are listed 'Best First'.
Re: Mods in different directories
by Abigail-II (Bishop) on Jan 31, 2004 at 00:24 UTC
    Instead of pushing or unshifting modules on @INC yourself, one could do what most people would do, and that's to use the lib pragma.

    use lib is your friend.

    Abigail

      Nice! Funny how I've never noticed that pragma. :-)

      Dean