Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: two lib folders

by Belgarion (Chaplain)
on Dec 05, 2005 at 21:28 UTC ( [id://514244]=note: print w/replies, xml ) Need Help??


in reply to Re^2: two lib folders
in thread two lib folders

Yes, or you could combine them into one list:

use lib ('/path/to/1/', '/path/to/2/');

Each time you do a use lib adds those directories in the list to the @INC array.

Replies are listed 'Best First'.
Re^4: two lib folders
by davidrw (Prior) on Dec 05, 2005 at 22:09 UTC
    that needs to be
    use lib ('/path/to/2/', '/path/to/1/');
    To be consistent with the above post of
    use lib "/path/to/1/"; use lib "/path/to/2/";
    Full demo:
    [davidrw@host davidrw]$ perl -le 'use lib qw(/path/to/1/); use lib qw( +/path/to/2/); print join " ", @INC[0..1]' /path/to/2/ /path/to/1/ [davidrw@host davidrw]$ perl -le 'use lib qw(/path/to/1/ /path/to/2/); + print join " ", @INC[0..1]' /path/to/1/ /path/to/2/

      Good point! use lib internally reverses the list passed into the import() function. This allows import() to prepend the entire list onto @INC in the same order as shown on the use lib line. Subtle.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-07-14 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.