]> sipb.mit.edu Git - wiki.git/commitdiff
Refactor cheat-sheet to the end.
authorNelson Elhage <nelhage@mit.edu>
Sun, 20 Dec 2009 15:49:02 +0000 (10:49 -0500)
committersipb-www <sipb-www@busy-beaver.mit.edu>
Sun, 20 Dec 2009 15:49:02 +0000 (10:49 -0500)
doc/cpan.mdwn

index fd1346b042a90ff4fd41d5228b6e6a1dc63b604a..4c9ca306a42273daadb4be130cc6edd106aeca75 100644 (file)
@@ -1,5 +1,7 @@
 [[!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?
@@ -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
+<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