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

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.

Replies are listed 'Best First'.
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.


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

Re: Multiple Path in use lib
by Joost (Canon) on Jul 03, 2006 at 12:41 UTC
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 :)
Re: Multiple Path in use lib
by madtoperl (Pilgrim) 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,


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://558980]
Approved by Corion
[Corion]: Mhhmmm - https://sod.pixlab .io/ looks really interesting for embedding with Perl (XS), but they don't have any kind of free model available and the cheapest pretrained model costs EUR 40 :-(
[Corion]: Maybe I should mail them to find out if they can provide me a "hotdog / no hotdog" model for developping the XS bindings. It would be nice to have a self-contained XS library for applying models to data. Or maybe I should look at TensorFlow, which can...
[Corion]: ... at least be trained by me, instead of relying on a vendor

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-06-18 10:40 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (109 votes). Check out past polls.