document updated 14 years ago, on Jan 6, 2010
Installing CPAN modules as a normal user, rather than root.
- just configure CPAN.pm correctly:
- first, understand the concept of PREFIX, and pick which directory you want to use for that (for this example, I'll use /home/myself/cpan/)
- o conf makepl_arg "PREFIX=/home/myself/cpan/"
- o conf mbuild_arg "--prefix=/home/myself/cpan/"
- set your PERL5LIB to reference $PREFIX/lib/ (and variants thereof)
- local::lib is supposed to make this much easier, but I've had problems running it on older (Perl v5.6) systems
- PAR is a cross-platform packaging and deployment tool. It builds simple packages that include both pure-Perl and compiled binary (xs) files inside a .par file, that can be unpacked on the client side (and even installed client-side). "PAR itself is now pure-Perl and can be installed even without a C development environment."
- If the modules you need are pure-Perl, you can concatenate them all into a single file. The standalone version of ack does this, as does
- 2004 writeup
- I've got my own hacked program that was tailored to the CPAN modules circa ~2006
- 2007 article
- CGIPAN — installs CPAN modules via CGI. (woah, cool, I hadn't thought of that)