[sf-perl] /usr/local/foo/ for cpan and locally grown modules

Bill Moseley moseley at hank.org
Mon Feb 19 16:59:49 PST 2007


On Mon, Feb 19, 2007 at 04:42:38PM -0800, Garth Webb wrote:
> You don't need to include it as "/usr/local/FOO/lib/perl".  If you use
> PREFIX just use that same value for 'use lib', ie:
> 
>  $ perl Makefile.PL PREFIX /usr/local/FOO
>  ...
>  $ cat yourprog.pl
>  #!/usr/bin/perl -w
> 
>  use lib qw(/usr/local/FOO);
>  ...
> 
> 'lib' knows how to find your modules.

Not that I've seen.  Either have to specify LIB or add additional
paths to @INC.

$ perl Makefile.PL PREFIX=$HOME/crypt

$ make install
Installing /home/moseley/crypt/share/perl/5.8.8/Crypt/PasswdMD5.pm
Installing /home/moseley/crypt/man/man3/Crypt::PasswdMD5.3pm
Writing
/home/moseley/crypt/lib/perl/5.8.8/auto/Crypt/PasswdMD5/.packlist
Appending installation info to
/home/moseley/crypt/lib/perl/5.8.8/perllocal.pod


$ PERL5LIB=$HOME/crypt perl -MCrypt::PasswdMD5
Can't locate Crypt/PasswdMD5.pm in @INC (@INC contains:
/home/moseley/crypt /etc/perl /usr/local/lib/perl/5.8.8
/usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl
/usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7
/usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4
/usr/local/lib/perl/5.8.2 /usr/local/share/perl/5.8.2
/usr/local/lib/perl/5.8.1 /usr/local/share/perl/5.8.1
/usr/local/lib/perl/5.8.0 /usr/local/share/perl/5.8.0 .).
BEGIN failed--compilation aborted.




$ perl Makefile.PL PREFIX=$HOME/crypt LIB=$HOME/crypt

$ make install
Manifying blib/man3/Crypt::PasswdMD5.3pm
Installing /home/moseley/crypt/Crypt/PasswdMD5.pm



$ PERL5LIB=$HOME/crypt perl -MCrypt::PasswdMD5  -e 1


-- 
Bill Moseley
moseley at hank.org



More information about the SanFrancisco-pm mailing list