Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Mods in different directories

by crabbdean (Pilgrim)
on Jan 31, 2004 at 00:10 UTC ( [id://325460]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://325460]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-20 00:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found