Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

two lib folders

by Anonymous Monk
on Dec 05, 2005 at 21:10 UTC ( [id://514236]=perlquestion: print w/replies, xml ) Need Help??

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

Is it possible to have two lib folders on a web site? My host doesn't have all the modules I need preinstalled so I have one lib folder for those.

They said I need to call a different folder for the Image::Magick module. So how can I call modules from TWO different places? They said it's istalled but I need to call the directory /usr/bin/.

Replies are listed 'Best First'.
Re: two lib folders
by Belgarion (Chaplain) on Dec 05, 2005 at 21:17 UTC

    I'm assuming you mean something like:

    use lib ('/path/to/your/lib');

    That would add /path/to/your/lib to your @INC path. Do a perldoc on lib to find out more information.

      Here's a link: lib
      Is this saying I could make multiple use libs?
      use lib "/path/to/1/"; use lib "/path/to/2/";

        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.

Re: two lib folders
by ercparker (Hermit) on Dec 05, 2005 at 21:48 UTC
    here is another variation:
    use lib qw( /usr/bin /another/path /and/another/path );
    Hope that helps
Re: two lib folders
by wazzuteke (Hermit) on Dec 05, 2005 at 22:55 UTC
    If you have access to the proper user on the server or the config file(s), and assuming you are running a Linux box, one thing I like to do is set my Perl library using environment variables. Sometimes, it's a little cleaner when you know every script/module will/might need to use it:
    shell:~>PERL5LIB='/usr/bin' shell:~>export PERL5LIB
    Hope that helps!

    ---hA||ta----
    print map{$_.' '}grep{/\w+/}@{[reverse(qw{Perl Code})]} or die while ( 'trying' );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://514236]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-09-19 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (25 votes). Check out past polls.

    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.