Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Multiple Path in use lib

by gopalr (Priest)
on Jul 03, 2006 at 12:35 UTC ( #558980=perlquestion: print w/ replies, xml ) Need Help??
gopalr has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Can we use multiple path in use lib '<path>'.

If yes, please let me know how.

Thanks in Advance,
Gopal R.

Comment on Multiple Path in use lib
Download Code
Re: Multiple Path in use lib
by Joost (Canon) on Jul 03, 2006 at 12:41 UTC
Re: Multiple Path in use lib
by davorg (Chancellor) on Jul 03, 2006 at 12:41 UTC

    The documentation for the lib pragma says this:

    use lib LIST;

    and this:

    The parameters to use lib are added to the start of the perl search path.

    (Note the plural "parameters")

    From that we can assume that we can pass a list of directories to use lib and it will do what we expect.

    use lib qw(/path/to/one/library /path/to/another);

    Of course, multiple calls to use lib work too.

    use lib '/path/to/one/library'; use lib '/path/to/another';

    It's always well worth checking the documentation for answers to questions like this.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: Multiple Path in use lib
by madtoperl (Monk) on Jul 03, 2006 at 12:52 UTC
    Hi Gopal,

    Yes,ofcourse you can include.If you want to include more than one path you have to use use lib qw(<path1> <path2> .. <pathn>)

    Thanks and Regards,

    madtoperl.
Re: Multiple Path in use lib
by davidrw (Prior) on Jul 03, 2006 at 15:09 UTC
Re: Multiple Path in use lib
by Ieronim (Friar) on Jul 03, 2006 at 16:47 UTC
    BTW, but a little off-topic
    if you often need to use the same "use lib DIRS" directive, create an environment variable PERL5LIB containing directory names separated by a colon or semicolon (see perlrun for details) and forget about typing it :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-09-21 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (167 votes), past polls