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

I've been hearing good things about local::lib lately, and would like to give it a try, but after looking at its docs I'm still having a difficult time understanding what it provides and how to use it.

Does it create what is effectively another site_perl for me in my home directory (by default, ~/perl5)?

After I start up my cpanp shell, do I have to tell it anything special for it to automatically install modules into my ~/perl5? How about when using cpan and/or cpanminus?

In my own scripts, when I wish to use modules installed into my ~/perl5, do I simply put use lib /home/myname/perl5; into my script, or am I supposed to use local::lib here in some way?

Are there any environment variables I need to set for local::lib to work properly?

Note: it looks as if local::lib can also be used to programmatically install modules from within a script, but I don't believe I'm asking about that.

  • Comment on Help understanding what local::lib does and how to use it.

Replies are listed 'Best First'.
Re: Help understanding what local::lib does and how to use it.
by Your Mother (Archbishop) on Feb 24, 2010 at 22:14 UTC

    You should probably follow "The bootstrapping technique" section of local::lib verbatim (almost to the end; a couple of the last parts are optional) and ignore the rest of the Pod. It answers all of your questions, if not explicitly, with the sample code/instructions. If you get stuck, come back with exactly what you did and what output/errors you saw.

    I found it confusing at first too. I have been successfully using the bootstrap instructions in four different *nixes (home, office, project sites) for a couple of years.