Install in a custom directory
Problem
You want to install SOAP::Lite, but don’t have root/administrator privileges.
Solution
Install SOAP::Lite into a custom directory using CPAN module:
# perl -MCPAN -e shell
> o conf make_arg -I~/lib
> o conf make_install_arg -I~/lib
> o conf makepl_arg LIB=~/lib PREFIX=~ INSTALLMAN1DIR=~/man/man1 INSTALLMAN3DIR=~/man/man3
> install SOAP::Lite
Discussion
Setup PERL5LIB environment variable. Depending on your shell it may look like:
PERL5LIB=/you/home/directory/lib; export PERL5LIB
lib here is the name of directory where all libraries will be installed under your home directory.
Run CPAN module with
perl -MCPAN -e shell
and run three commands from CPAN shell
> o conf make_arg -I~/lib
> o conf make_install_arg -I~/lib
> o conf makepl_arg LIB=~/lib PREFIX=~ INSTALLMAN1DIR=~/man/man1 INSTALLMAN3DIR=~/man/man3
LIB will specify directory where all libraries will reside.
PREFIX will specify prefix for all directories (like lib, bin, man, though it doesn’t work in all cases for some reason).
INSTALLMAN1DIR and INSTALLMAN3DIR specify directories for manuals (if you don’t specify them, install will fail because it’ll try to setup it in default directory and you don’t have permissions for that).
Then run:
> install SOAP::Lite
Now in your scripts you need to specify:
use lib ‘/your/home/directory/lib’;
somewhere before ‘use SOAP::Lite;’