Installing Non-Core Perl ModulesStuart Abrams-Humphries, March 2007 This document shows how to install non-core Perl modules in environments running the Solaris Operating System and Linux. This procedure can give application and development teams more control over what Perl modules they use, upgrade, and remove. (Note: This should work with all versions of the Solaris OS and Linux.) IntroductionTo enable a simple installation of Perl on all machines, application and development teams can install non-core Perl modules in directories they control. Installing non-core Perl modules lets teams use, upgrade, and remove non-core modules without affecting any extra Perl modules that have been added to a machine. It also means that the modules can be used with an upgraded version of Perl, if necessary. Additionally, in a clustered environment, the non-core Perl modules can be installed on a shared disk so they will be consistent across all nodes in a cluster when a service group fails over between machines. PrerequisitesThe non-core Perl module needs to be built with the same version of the C compiler as Perl itself was built with. To see which compiler Perl was built with, type the following command: perl -V Then ensure that the same compiler version is installed on the machine, whether it's the GNU Compiler Collection (GCC) or the Sun Studio C compiler (or an older version). InstallationFollow these steps to install a non-core Perl module on a machine: 1. Download the Perl module source (for example, from CPAN, the Comprehensive Perl Archive Network web site). 2. Normally, you will have a 3. Extract the module file: tar -xvzf <modulename>.tar.gz Alternatively, you can decompress the file using 4. Create a perl Makefile.PL PREFIX=<moduleinstalldir> LIB=<moduleinstalldir>/lib INSTALLMAN1DIR=<moduleinstalldir>/man/man1 INSTALLMAN3DIR=<moduleinstalldir>/man/man3 5. Run the make 6. Install the module: make install Using the New ModuleTo use the newly installed Perl module, insert the following lines at the top of your Perl scripts: #!/usr/bin/perl use lib '<moduleinstalldir>/lib'; use mod::bang; Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
| |||