[sf-perl] local::lib

Tatsuhiko Miyagawa miyagawa at gmail.com
Mon Mar 21 12:19:44 PDT 2011

Just so you know, cpanm supports local::lib natively - with the -l
option. It actually checks if you have a write permission to your
site_perl and otherwise fall back to your ~/perl5 as local::lib
directory by default. (You can override that with -l option, or run it
with --sudo to install modules using sudo)

  cpanm -l ~/perl5 DBI

will install DBI modules to your ~/perl5/lib/perl5 - and then you can
source the same local::lib output or can add
-Mlib=$HOME/perl5/lib/perl5 to your PERL5OPT, either way it just works.

2011/3/21 Matthew Lanier <matt at lanier.org>:
> if you look at the output from a local::lib install, it also sets some
> convenience variables that some might miss, such as MM and MB configuration.
>  yes, it's basically a wrapper around knowing how to set your PERL5LIB and
> other vars properly, which some can.
> m@
> On Mon, 21 Mar 2011, Fred Moyer wrote:
>> On Mon, Mar 21, 2011 at 7:47 AM, Matthew Lanier <matt at lanier.org> wrote:
>>> perl folk-
>>> i helped a coworker through local::lib setup last week, in exchange for
>>> him
>>> writing up the steps to share.  here they are (pardon his snark....)
>>> http://blog.cmyers.org/index.php/2011/03/18/reproducble-change-controlled-perl-deployment-with-locallib/
>> Maybe I'm missing the point of local::lib, but the same goal can be
>> accomplished by installing a copy of perl in a non-system directory
>> with the PREFIX option:
>> sh Configure -Dprefix=$HOME/perl
>> This has the added benefit of not needing the local::lib module
>> dependency, making the program portable across any Perl installation
>> that has the required modules installed.
>>> m@
>>> --
>>> Matthew D. P. K. Lanier
>>> _______________________________________________
>>> SanFrancisco-pm mailing list
>>> SanFrancisco-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

Tatsuhiko Miyagawa

More information about the SanFrancisco-pm mailing list