1. Install the Perl module to a non-custom directory
How do I get makemaker and module: build to install to the same place? Module: build, as of 0.28, supports two ways to install to the same location as makemaker.1) Use install_base/-- install_basemakemaker (as of 6.31) and module :: build (as of 0.28) both can install to the same locations 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 location. perl makefile. PL install_base =/whatever Perl build. pl -- install_base/whatever2) Use prefix/-- prefixmodule: Build 0.28 added support for -- prefix which works like makemaker's prefix. perl makefile. PL prefix =/whatever Perl build. pl -- prefix/whatever
2. Use modules 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 ~ /Perl5use local: Lib '~ /Foo '; # Same, ~ /Foo
# Or... use findbin; use local: lib "$ findbin: Bin /.. /support "; # app-local support libraryuse findbin; Use lib" $ findbin: Bin /.. /lib ";
# Oruse findbin QW ($ bin); Use lib "$ bin/../lib ";
3. Find the installed modules
1. shell script: Find 'perl-e' print "@ INC" ''-name' *. PM '-print2. Perl script :#! /Usr/bin/perluse strict; Use extutils: installed; my $ inst = extutils: installed-> New (); my @ modules = $ inst-> modules (); foreach (@ modules) {my $ ver = $ inst-> Version ($ _) | "? "; Printf ("%-12 S-% s \ n", $ _, $ ver);} exit 0;
Complete!