Using CPAN with Perl
“CPAN” stands for the Comprehensive Perl Archive Network and is an internationally mirrored collection of over 30,000 packages of re-usable Perl code. To program in Perl 5 effectively, one needs to make a judicious, but liberal use of CPAN code, due to the fact that the perl core distribution is kept relatively minimal and its maintainers expect people to use CPAN for any extraneous functionality.
One good advice in using CPAN is to look for native packages for your operating system, distribution and Perl distribution. Many such distributions allow one to automatically install pre-built CPAN packages that can later on be easily and cleanly uninstalled. Look for such packages for distributions you need in the relevant repositories of the distribution of perl 5 that you are using.
If you cannot find packages for what you want, you can also try building a native package automatically from the equivalent CPAN package. We have the details of wrappers of CPAN modules for the various distributions (originally from the PerlNet wiki).
Links
Life with CPAN
"Using CPAN with a non-root account" (restored from the original at Jeremy Mates' web-site).
"Life with CPAN" (restored from the original at Jeremy Mates' web-site).
local-lib - install CPAN modules under a local user directory.
"But I can't use CPAN!" - an essay by Matt S. Trout explaining why you can almost always use CPAN, and the various ways you can do it.
“mstpan 9 — Library Deployment” - a similar document by the same author with some updates.
These resources provide a gentle introduction to how to effectively work with CPAN in case you want to use it directly. Read them in order.
Finding Stuff on the CPAN
- “Finding Stuff on CPAN” - article explaining how to find good stuff on the CPAN by inspiration from an old feature on catalyzed.org .
- metacpan.org - an enhanced and open-source interface for searching CPAN and finding information about CPAN modules.
Preparing Your Own CPAN-like Distributions
“RFC: How to Release Modules on CPAN in 2011” - a modern and comprehensive guide by Elisheva on Perlmonks.org.
CPAN for Private Code - why you should prepare CPAN-like distributions, even for code intended for internal use only. SlideShare presentation by Jeffrey Thalhammer. (Local mirror under the CC-by licence)