http://qs321.pair.com?node_id=762455

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

If I want to install a CPAN module in a location that doesn't interfere with my package manager, I typically use
perl Makefile.PL INSTALLBASE=/home/me/perl-lib
and then use

PERL5LIB=/home/me/perl-lib/lib/perl5 perl-script
to run scripts using that new hierarchy of perl libs.

However, instead of using an ENV variable, I'd like to use code like

use lib '/home/me/perl-lib/lib/perl5';
which, unfortunately, and contrary to the explanation in perlrun, isn't the same. For example, if you have architecture-dependent code that ends up in something like /home/me/perl-lib/lib/perl5/i686-linux-thread-multi, then PERL5LIB set to /home/me/perl-lib/lib/perl5 will find it, while 'use lib' won't.

Questions:

  1. What are you doing to keep Perl modules installed by your package manager and CPAN modules separate?
  2. Is INSTALLBASE still the recommended way of installing modules in a different than the standard location with MakeMaker?
  3. Is there a directive in Perl that does what PERL5LIB does (without using PERL5LIB)?
Thanks for any insight.