From 3b01173437a97b57573b0c3ad9ee78b395a1c185 Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Sun, 20 Dec 2009 10:49:02 -0500 Subject: [PATCH] Refactor cheat-sheet to the end. --- doc/cpan.mdwn | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/doc/cpan.mdwn b/doc/cpan.mdwn index fd1346b..4c9ca30 100644 --- a/doc/cpan.mdwn +++ b/doc/cpan.mdwn @@ -1,5 +1,7 @@ [[!meta title="Using CPAN"]] +If you're mostly familiar with this document, and just want the incants, skip to the cheat sheet. + [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? @@ -10,17 +12,6 @@ If you are running Debian or Ubuntu, the Perl module `Foo::Bar` will be present, 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: @@ -42,3 +33,14 @@ By default, CPAN prompts you whether or not to follow dependencies when installi `env PERL_MM_USE_DEFAULT=1 cpan` +## Cheat-sheet + + +### 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 -- 2.44.0