[[!meta title="Using CPAN"]]
+If you're mostly familiar with this document, and just want the incants, skip to the <a href="#cheatsheet">cheat sheet</a>.
+
[CPAN](http://cpan.org) is the "Comprehensive Perl Archive Network", a repository of useful Perl modules. Most projects written in Perl depend on at least one module from CPAN, and dependency graphs of dozens of modules are not uncommon. Unfortunately, installing CPAN modules can be somewhat tricky, in part due to the age of many of the tools involved. This document is designed to help someone who is not a Perl programmer learn how to get a CPAN module or set of modules installed with a minimum of pain.
## Is it in my distribution?
yum whatprovides 'perl(Foo::Bar)'
-## The short version (installing packages system-wide)
-
-If you want some more explanation, skip to the next section. This section is meant as a cheat-sheet for people who just want to remember the various incants. This assumes you want to install packages system-wide on the local system, and are a sudoer.
-
- $ env PERL_MM_USE_DEFAULT=1 cpan
- cpan> o conf make_install_make_command '/usr/bin/sudo /usr/bin/make'
- cpan> o conf mbuild_install_build_command '/usr/bin/sudo ./Build'
- cpan> o conf prerequisites_policy follow
- cpan> o conf commit
- cpan> install Some::Module
-
## Installing packages system-wide
The easiest way to use CPAN is to install packages system-wide. Run `cpan` as your user, and then enter the following commands to configure CPAN to use `sudo` to get root privileges to install packages:
`env PERL_MM_USE_DEFAULT=1 cpan`
+## Cheat-sheet
+<a name="cheatsheet" />
+
+### Installing packages system-wide
+
+ $ env PERL_MM_USE_DEFAULT=1 cpan
+ cpan> o conf make_install_make_command '/usr/bin/sudo /usr/bin/make'
+ cpan> o conf mbuild_install_build_command '/usr/bin/sudo ./Build'
+ cpan> o conf prerequisites_policy follow
+ cpan> o conf commit
+ cpan> install Some::Module