To install perl modules without root permission, this seems to work for me within cpan:

UPDATE the modern recommendation would be to use the (almost) excellent local::lib module. First, download the archive through the link on the right side of the CPAN search page. Unpack it somewhere and follow the instructions on the CPAN site: run perl Makefile.PL --bootstrap and add the necessary call to your shell profile.

Now you can (after log-out and log-in) just run perl -MCPAN -Mlocal::lib -eshell and have it do auto-configuration (remove your .cpan/CPAN directory first if you have a broken configuration), and “install”ing packages should just work.

(old content below)

o conf mbuildpl_arg "\
--lib=~/myperl/lib \
--installman1dir=~/myperl/man/man1 \
--installman3dir=~/myperl/man/man3 \
--installscript=~/myperl/bin \
--installbin=~/myperl/bin \

o conf makepl_arg "\
LIB=~/myperl/lib \
INSTALLMAN1DIR=~/myperl/man/man1 \
INSTALLMAN3DIR=~/myperl/man/man3 \
INSTALLSCRIPT=~/myperl/bin \
INSTALLBIN=~/myperl/bin \

o conf commit

Then add something like

export PERL5LIB=~/myperl/lib:~/myperl/lib/perl5/site_perl/5.10.0${PERL5LIB:+:}$PERL5LIB

to your .zshenv or environment profile. I had to add the site_perl dir because Sub::Uplevel installed there, yes, I’m too lazy to investigate. So beware of strange makefiles.

Now you can restart cpan with the PERL5LIB environment set and should be able to install modules.

I had to switch INSTALL_BASE for PREFIX in the past, ymmv.