Install Perl modules to a non-custom directory
How does I get Makemaker and Module::build to install to the same place? Module::build, as of 0.28, supports, ways to install to the same location as Makemaker. 1) Use Install_base/--install_base makemaker (as of 6.31) and Module::build (as of 0.28) both can INSTALL to the same lo Cations using the "install_base" concept. See "Install_base" in Extutils::makemaker for details. To get MM and MB to install to the same location simply set install_base in MM and--install_base in MB to the same locati On. Perl makefile.pl install_base=/whatever perl build.pl--install_base/whatever 2) Use PREFIX/--prefix Module::bui LD 0.28 added support for--prefix which works like Makemaker ' s prefix. Perl makefile.pl prefix=/whatever Perl build.pl--prefix/whatever
ii Use the module in the custom directory
BEGIN {push (@INC, '/opt/perl/lib ');}
BEGIN {unshift @INC, '/opt/perl/lib ';}
Use Lib '/opt/perl/lib ';
Use Local::lib; # sets up a local lib @ ~/perl5 use local::lib ' ~/foo '; # Same, but ~/foo
# Or ... use findbin; Use Local::lib "$FindBin:: bin/. /support "; # app-local Support library use Findbin; Use Lib "$FindBin:: bin/. /lib ";
# or use Findbin QW ($Bin); Use Lib "$Bin/.. /lib ";
Three find the installed Module 1. Shell script: Find ' perl-e ' print "@INC" '-name ' *.pm '-print 2. Perl script: #!/usr/bin/perl use strict; Use extutils::installed; My $inst = Extutils::installed->new (); My @modules = $inst->modules (); foreach (@modules) {My $ver = $inst->version ($_) | | “???”; printf ("%-12s-%s\n", $_, $ver); } exit 0;
Finish.