.Ve
.ie n .SS "Schema verification with ""Kwalify"""
.el .SS "Schema verification with \f(CWKwalify\fP"
.IX Subsection "Schema verification with Kwalify"
If you have the \f(CW\*(C`Kwalify\*(C'\fR module installed (which is part of the
Bundle::CPANxxl), then all your distroprefs files are checked for
syntactic correctness.
.SS "Example Distroprefs Files"
.IX Subsection "Example Distroprefs Files"
\&\f(CW\*(C`CPAN.pm\*(C'\fR comes with a collection of example \s-1YAML\s0 files. Note that these
are really just examples and should not be used without care because
they cannot fit everybody's purpose. After all, the authors of the
packages that ask questions had a need to ask, so you should watch
their questions and adjust the examples to your environment and your
needs. You have been warned:\-)
.SH "PROGRAMMER'S INTERFACE"
.IX Header "PROGRAMMER'S INTERFACE"
If you do not enter the shell, shell commands are
available both as methods (\f(CW\*(C`CPAN::Shell\->install(...)\*(C'\fR) and as
functions in the calling package (\f(CW\*(C`install(...)\*(C'\fR). Before calling low-level
commands, it makes sense to initialize components of \s-1CPAN\s0 you need, e.g.:
.PP
.Vb 3
\& CPAN::HandleConfig\->load;
\& CPAN::Shell::setup_output;
\& CPAN::Index\->reload;
.Ve
.PP
High-level commands do such initializations automatically.
.PP
There's currently only one class that has a stable interface \-
CPAN::Shell. All commands that are available in the \s-1CPAN\s0 shell are
methods of the class CPAN::Shell. The arguments on the commandline are
passed as arguments to the method.
.PP
So if you take for example the shell command
.PP
.Vb 1
\& notest install A B C
.Ve
.PP
the actually executed command is
.PP
.Vb 1
\& CPAN::Shell\->notest("install","A","B","C");
.Ve
.PP
Each of the commands that produce listings of modules (\f(CW\*(C`r\*(C'\fR,
\&\f(CW\*(C`autobundle\*(C'\fR, \f(CW\*(C`u\*(C'\fR) also return a list of the IDs of all modules
within the list.
.IP "expand($type,@things)" 2
.IX Item "expand($type,@things)"
The IDs of all objects available within a program are strings that can
be expanded to the corresponding real objects with the
\&\f(CW\*(C`CPAN::Shell\->expand("Module",@things)\*(C'\fR method. Expand returns a
list of CPAN::Module objects according to the \f(CW@things\fR arguments
given. In scalar context, it returns only the first element of the
list.
.IP "expandany(@things)" 2
.IX Item "expandany(@things)"
Like expand, but returns objects of the appropriate type, i.e.
CPAN::Bundle objects for bundles, CPAN::Module objects for modules, and
CPAN::Distribution objects for distributions. Note: it does not expand
to CPAN::Author objects.
.IP "Programming Examples" 2
.IX Item "Programming Examples"
This enables the programmer to do operations that combine
functionalities that are available in the shell.
.Sp
.Vb 2
\& # install everything that is outdated on my disk:
\& perl \-MCPAN \-e \*(AqCPAN::Shell\->install(CPAN::Shell\->r)\*(Aq
\&
\& # install my favorite programs if necessary:
\& for $mod (qw(Net::FTP Digest::SHA Data::Dumper)) {
\& CPAN::Shell\->install($mod);
\& }
\&
\& # list all modules on my disk that have no VERSION number
\& for $mod (CPAN::Shell\->expand("Module","/./")) {
\& next unless $mod\->inst_file;
\& # MakeMaker convention for undefined $VERSION:
\& next unless $mod\->inst_version eq "undef";
\& print "No VERSION in ", $mod\->id, "\en";
\& }
\&
\& # find out which distribution on CPAN contains a module:
\& print CPAN::Shell\->expand("Module","Apache::Constants")\->cpan_file
.Ve
.Sp
Or if you want to schedule a \fIcron\fR job to watch \s-1CPAN,\s0 you could list
all modules that need updating. First a quick and dirty way:
.Sp
.Vb 1
\& perl \-e \*(Aquse CPAN; CPAN::Shell\->r;\*(Aq
.Ve
.Sp
If you don't want any output should all modules be
up to date, parse the output of above command for the regular
expression \f(CW\*(C`/modules are up to date/\*(C'\fR and decide to mail the output
only if it doesn't match.
.Sp
If you prefer to do it more in a programmerish style in one single
process, something like this may better suit you:
.Sp
.Vb 7
\& # list all modules on my disk that have newer versions on CPAN
\& for $mod (CPAN::Shell\->expand("Module","/./")) {
\& next unless $mod\->inst_file;
\& next if $mod\->uptodate;
\& printf "Module %s is installed as %s, could be updated to %s from CPAN\en",
\& $mod\->id, $mod\->inst_version, $mod\->cpan_version;
\& }
.Ve
.Sp
If that gives too much output every day, you may want to
watch only for three modules. You can write
.Sp
.Vb 1
\& for $mod (CPAN::Shell\->expand("Module","/Apache|LWP|CGI/")) {
.Ve
.Sp
as the first line instead. Or you can combine some of the above
tricks:
.Sp
.Vb 5
\& # watch only for a new mod_perl module
\& $mod = CPAN::Shell\->expand("Module","mod_perl");
\& exit if $mod\->uptodate;
\& # new mod_perl arrived, let me know all update recommendations
\& CPAN::Shell\->r;
.Ve
.SS "Methods in the other Classes"
.IX Subsection "Methods in the other Classes"
.IP "\fBCPAN::Author::as_glimpse()\fR" 4
.IX Item "CPAN::Author::as_glimpse()"
Returns a one-line description of the author
.IP "\fBCPAN::Author::as_string()\fR" 4
.IX Item "CPAN::Author::as_string()"
Returns a multi-line description of the author
.IP "\fBCPAN::Author::email()\fR" 4
.IX Item "CPAN::Author::email()"
Returns the author's email address
.IP "\fBCPAN::Author::fullname()\fR" 4
.IX Item "CPAN::Author::fullname()"
Returns the author's name
.IP "\fBCPAN::Author::name()\fR" 4
.IX Item "CPAN::Author::name()"
An alias for fullname
.IP "\fBCPAN::Bundle::as_glimpse()\fR" 4
.IX Item "CPAN::Bundle::as_glimpse()"
Returns a one-line description of the bundle
.IP "\fBCPAN::Bundle::as_string()\fR" 4
.IX Item "CPAN::Bundle::as_string()"
Returns a multi-line description of the bundle
.IP "\fBCPAN::Bundle::clean()\fR" 4
.IX Item "CPAN::Bundle::clean()"
Recursively runs the \f(CW\*(C`clean\*(C'\fR method on all items contained in the bundle.
.IP "\fBCPAN::Bundle::contains()\fR" 4
.IX Item "CPAN::Bundle::contains()"
Returns a list of objects' IDs contained in a bundle. The associated
objects may be bundles, modules or distributions.
.IP "CPAN::Bundle::force($method,@args)" 4
.IX Item "CPAN::Bundle::force($method,@args)"
Forces \s-1CPAN\s0 to perform a task that it normally would have refused to
do. Force takes as arguments a method name to be called and any number
of additional arguments that should be passed to the called method.
The internals of the object get the needed changes so that \s-1CPAN\s0.pm
does not refuse to take the action. The \f(CW\*(C`force\*(C'\fR is passed recursively
to all contained objects. See also the section above on the \f(CW\*(C`force\*(C'\fR
and the \f(CW\*(C`fforce\*(C'\fR pragma.
.IP "\fBCPAN::Bundle::get()\fR" 4
.IX Item "CPAN::Bundle::get()"
Recursively runs the \f(CW\*(C`get\*(C'\fR method on all items contained in the bundle
.IP "\fBCPAN::Bundle::inst_file()\fR" 4
.IX Item "CPAN::Bundle::inst_file()"
Returns the highest installed version of the bundle in either \f(CW@INC\fR or
\&\f(CW\*(C`$CPAN::Config\->{cpan_home}\*(C'\fR. Note that this is different from
CPAN::Module::inst_file.
.IP "\fBCPAN::Bundle::inst_version()\fR" 4
.IX Item "CPAN::Bundle::inst_version()"
Like CPAN::Bundle::inst_file, but returns the \f(CW$VERSION\fR
.IP "\fBCPAN::Bundle::uptodate()\fR" 4
.IX Item "CPAN::Bundle::uptodate()"
Returns 1 if the bundle itself and all its members are up-to-date.
.IP "\fBCPAN::Bundle::install()\fR" 4
.IX Item "CPAN::Bundle::install()"
Recursively runs the \f(CW\*(C`install\*(C'\fR method on all items contained in the bundle
.IP "\fBCPAN::Bundle::make()\fR" 4
.IX Item "CPAN::Bundle::make()"
Recursively runs the \f(CW\*(C`make\*(C'\fR method on all items contained in the bundle
.IP "\fBCPAN::Bundle::readme()\fR" 4
.IX Item "CPAN::Bundle::readme()"
Recursively runs the \f(CW\*(C`readme\*(C'\fR method on all items contained in the bundle
.IP "\fBCPAN::Bundle::test()\fR" 4
.IX Item "CPAN::Bundle::test()"
Recursively runs the \f(CW\*(C`test\*(C'\fR method on all items contained in the bundle
.IP "\fBCPAN::Distribution::as_glimpse()\fR" 4
.IX Item "CPAN::Distribution::as_glimpse()"
Returns a one-line description of the distribution
.IP "\fBCPAN::Distribution::as_string()\fR" 4
.IX Item "CPAN::Distribution::as_string()"
Returns a multi-line description of the distribution
.IP "CPAN::Distribution::author" 4
.IX Item "CPAN::Distribution::author"
Returns the CPAN::Author object of the maintainer who uploaded this
distribution
.IP "\fBCPAN::Distribution::pretty_id()\fR" 4
.IX Item "CPAN::Distribution::pretty_id()"
Returns a string of the form \*(L"\s-1AUTHORID/TARBALL\*(R",\s0 where \s-1AUTHORID\s0 is the
author's \s-1PAUSE ID\s0 and \s-1TARBALL\s0 is the distribution filename.
.IP "\fBCPAN::Distribution::base_id()\fR" 4
.IX Item "CPAN::Distribution::base_id()"
Returns the distribution filename without any archive suffix. E.g
\&\*(L"Foo\-Bar\-0.01\*(R"
.IP "\fBCPAN::Distribution::clean()\fR" 4
.IX Item "CPAN::Distribution::clean()"
Changes to the directory where the distribution has been unpacked and
runs \f(CW\*(C`make clean\*(C'\fR there.
.IP "\fBCPAN::Distribution::containsmods()\fR" 4
.IX Item "CPAN::Distribution::containsmods()"
Returns a list of IDs of modules contained in a distribution file.
Works only for distributions listed in the 02packages.details.txt.gz
file. This typically means that just most recent version of a
distribution is covered.
.IP "\fBCPAN::Distribution::cvs_import()\fR" 4
.IX Item "CPAN::Distribution::cvs_import()"
Changes to the directory where the distribution has been unpacked and
runs something like
.Sp
.Vb 1
\& cvs \-d $cvs_root import \-m $cvs_log $cvs_dir $userid v$version
.Ve
.Sp
there.
.IP "\fBCPAN::Distribution::dir()\fR" 4
.IX Item "CPAN::Distribution::dir()"
Returns the directory into which this distribution has been unpacked.
.IP "CPAN::Distribution::force($method,@args)" 4
.IX Item "CPAN::Distribution::force($method,@args)"
Forces \s-1CPAN\s0 to perform a task that it normally would have refused to
do. Force takes as arguments a method name to be called and any number
of additional arguments that should be passed to the called method.
The internals of the object get the needed changes so that \s-1CPAN\s0.pm
does not refuse to take the action. See also the section above on the
\&\f(CW\*(C`force\*(C'\fR and the \f(CW\*(C`fforce\*(C'\fR pragma.
.IP "\fBCPAN::Distribution::get()\fR" 4
.IX Item "CPAN::Distribution::get()"
Downloads the distribution from \s-1CPAN\s0 and unpacks it. Does nothing if
the distribution has already been downloaded and unpacked within the
current session.
.IP "\fBCPAN::Distribution::install()\fR" 4
.IX Item "CPAN::Distribution::install()"
Changes to the directory where the distribution has been unpacked and
runs the external command \f(CW\*(C`make install\*(C'\fR there. If \f(CW\*(C`make\*(C'\fR has not
yet been run, it will be run first. A \f(CW\*(C`make test\*(C'\fR is issued in
any case and if this fails, the install is cancelled. The
cancellation can be avoided by letting \f(CW\*(C`force\*(C'\fR run the \f(CW\*(C`install\*(C'\fR for
you.
.Sp
This install method only has the power to install the distribution if
there are no dependencies in the way. To install an object along with all
its dependencies, use CPAN::Shell\->install.
.Sp
Note that \fBinstall()\fR gives no meaningful return value. See \fBuptodate()\fR.
.IP "\fBCPAN::Distribution::isa_perl()\fR" 4
.IX Item "CPAN::Distribution::isa_perl()"
Returns 1 if this distribution file seems to be a perl distribution.
Normally this is derived from the file name only, but the index from
\&\s-1CPAN\s0 can contain a hint to achieve a return value of true for other
filenames too.
.IP "\fBCPAN::Distribution::look()\fR" 4
.IX Item "CPAN::Distribution::look()"
Changes to the directory where the distribution has been unpacked and
opens a subshell there. Exiting the subshell returns.
.IP "\fBCPAN::Distribution::make()\fR" 4
.IX Item "CPAN::Distribution::make()"
First runs the \f(CW\*(C`get\*(C'\fR method to make sure the distribution is
downloaded and unpacked. Changes to the directory where the
distribution has been unpacked and runs the external commands \f(CW\*(C`perl
Makefile.PL\*(C'\fR or \f(CW\*(C`perl Build.PL\*(C'\fR and \f(CW\*(C`make\*(C'\fR there.
.IP "\fBCPAN::Distribution::perldoc()\fR" 4
.IX Item "CPAN::Distribution::perldoc()"
Downloads the pod documentation of the file associated with a
distribution (in \s-1HTML\s0 format) and runs it through the external
command \fIlynx\fR specified in \f(CW\*(C`$CPAN::Config\->{lynx}\*(C'\fR. If \fIlynx\fR
isn't available, it converts it to plain text with the external
command \fIhtml2text\fR and runs it through the pager specified
in \f(CW\*(C`$CPAN::Config\->{pager}\*(C'\fR.
.IP "\fBCPAN::Distribution::prefs()\fR" 4
.IX Item "CPAN::Distribution::prefs()"
Returns the hash reference from the first matching \s-1YAML\s0 file that the
user has deposited in the \f(CW\*(C`prefs_dir/\*(C'\fR directory. The first
succeeding match wins. The files in the \f(CW\*(C`prefs_dir/\*(C'\fR are processed
alphabetically, and the canonical distro name (e.g.
AUTHOR/Foo\-Bar\-3.14.tar.gz) is matched against the regular expressions
stored in the \f(CW$root\fR\->{match}{distribution} attribute value.
Additionally all module names contained in a distribution are matched
against the regular expressions in the \f(CW$root\fR\->{match}{module} attribute
value. The two match values are ANDed together. Each of the two
attributes are optional.
.IP "\fBCPAN::Distribution::prereq_pm()\fR" 4
.IX Item "CPAN::Distribution::prereq_pm()"
Returns the hash reference that has been announced by a distribution
as the \f(CW\*(C`requires\*(C'\fR and \f(CW\*(C`build_requires\*(C'\fR elements. These can be
declared either by the \f(CW\*(C`META.yml\*(C'\fR (if authoritative) or can be
deposited after the run of \f(CW\*(C`Build.PL\*(C'\fR in the file \f(CW\*(C`./_build/prereqs\*(C'\fR
or after the run of \f(CW\*(C`Makfile.PL\*(C'\fR written as the \f(CW\*(C`PREREQ_PM\*(C'\fR hash in
a comment in the produced \f(CW\*(C`Makefile\*(C'\fR. \fINote\fR: this method only works
after an attempt has been made to \f(CW\*(C`make\*(C'\fR the distribution. Returns
undef otherwise.
.IP "\fBCPAN::Distribution::readme()\fR" 4
.IX Item "CPAN::Distribution::readme()"
Downloads the \s-1README\s0 file associated with a distribution and runs it
through the pager specified in \f(CW\*(C`$CPAN::Config\->{pager}\*(C'\fR.
.IP "\fBCPAN::Distribution::reports()\fR" 4
.IX Item "CPAN::Distribution::reports()"
Downloads report data for this distribution from www.cpantesters.org
and displays a subset of them.
.IP "\fBCPAN::Distribution::read_yaml()\fR" 4
.IX Item "CPAN::Distribution::read_yaml()"
Returns the content of the \s-1META\s0.yml of this distro as a hashref. Note:
works only after an attempt has been made to \f(CW\*(C`make\*(C'\fR the distribution.
Returns undef otherwise. Also returns undef if the content of \s-1META\s0.yml
is not authoritative. (The rules about what exactly makes the content
authoritative are still in flux.)
.IP "\fBCPAN::Distribution::test()\fR" 4
.IX Item "CPAN::Distribution::test()"
Changes to the directory where the distribution has been unpacked and
runs \f(CW\*(C`make test\*(C'\fR there.
.IP "\fBCPAN::Distribution::uptodate()\fR" 4
.IX Item "CPAN::Distribution::uptodate()"
Returns 1 if all the modules contained in the distribution are
up-to-date. Relies on containsmods.
.IP "\fBCPAN::Index::force_reload()\fR" 4
.IX Item "CPAN::Index::force_reload()"
Forces a reload of all indices.
.IP "\fBCPAN::Index::reload()\fR" 4
.IX Item "CPAN::Index::reload()"
Reloads all indices if they have not been read for more than
\&\f(CW\*(C`$CPAN::Config\->{index_expire}\*(C'\fR days.
.IP "\fBCPAN::InfoObj::dump()\fR" 4
.IX Item "CPAN::InfoObj::dump()"
CPAN::Author, CPAN::Bundle, CPAN::Module, and CPAN::Distribution
inherit this method. It prints the data structure associated with an
object. Useful for debugging. Note: the data structure is considered
internal and thus subject to change without notice.
.IP "\fBCPAN::Module::as_glimpse()\fR" 4
.IX Item "CPAN::Module::as_glimpse()"
Returns a one-line description of the module in four columns: The
first column contains the word \f(CW\*(C`Module\*(C'\fR, the second column consists
of one character: an equals sign if this module is already installed
and up-to-date, a less-than sign if this module is installed but can be
upgraded, and a space if the module is not installed. The third column
is the name of the module and the fourth column gives maintainer or
distribution information.
.IP "\fBCPAN::Module::as_string()\fR" 4
.IX Item "CPAN::Module::as_string()"
Returns a multi-line description of the module
.IP "\fBCPAN::Module::clean()\fR" 4
.IX Item "CPAN::Module::clean()"
Runs a clean on the distribution associated with this module.
.IP "\fBCPAN::Module::cpan_file()\fR" 4
.IX Item "CPAN::Module::cpan_file()"
Returns the filename on \s-1CPAN\s0 that is associated with the module.
.IP "\fBCPAN::Module::cpan_version()\fR" 4
.IX Item "CPAN::Module::cpan_version()"
Returns the latest version of this module available on \s-1CPAN.\s0
.IP "\fBCPAN::Module::cvs_import()\fR" 4
.IX Item "CPAN::Module::cvs_import()"
Runs a cvs_import on the distribution associated with this module.
.IP "\fBCPAN::Module::description()\fR" 4
.IX Item "CPAN::Module::description()"
Returns a 44 character description of this module. Only available for
modules listed in The Module List (CPAN/modules/00modlist.long.html
or 00modlist.long.txt.gz)
.IP "\fBCPAN::Module::distribution()\fR" 4
.IX Item "CPAN::Module::distribution()"
Returns the CPAN::Distribution object that contains the current
version of this module.
.IP "\fBCPAN::Module::dslip_status()\fR" 4
.IX Item "CPAN::Module::dslip_status()"
Returns a hash reference. The keys of the hash are the letters \f(CW\*(C`D\*(C'\fR,
\&\f(CW\*(C`S\*(C'\fR, \f(CW\*(C`L\*(C'\fR, \f(CW\*(C`I\*(C'\fR, and , for development status, support level,
language, interface and public licence respectively. The data for the
\&\s-1DSLIP\s0 status are collected by pause.perl.org when authors register
their namespaces. The values of the 5 hash elements are one-character
words whose meaning is described in the table below. There are also 5
hash elements \f(CW\*(C`DV\*(C'\fR, \f(CW\*(C`SV\*(C'\fR, \f(CW\*(C`LV\*(C'\fR, \f(CW\*(C`IV\*(C'\fR, and <\s-1PV\s0> that carry a more
verbose value of the 5 status variables.
.Sp
Where the '\s-1DSLIP\s0' characters have the following meanings:
.Sp
.Vb 7
\& D \- Development Stage (Note: *NO IMPLIED TIMESCALES*):
\& i \- Idea, listed to gain consensus or as a placeholder
\& c \- under construction but pre\-alpha (not yet released)
\& a/b \- Alpha/Beta testing
\& R \- Released
\& M \- Mature (no rigorous definition)
\& S \- Standard, supplied with Perl 5
\&
\& S \- Support Level:
\& m \- Mailing\-list
\& d \- Developer
\& u \- Usenet newsgroup comp.lang.perl.modules
\& n \- None known, try comp.lang.perl.modules
\& a \- abandoned; volunteers welcome to take over maintenance
\&
\& L \- Language Used:
\& p \- Perl\-only, no compiler needed, should be platform independent
\& c \- C and perl, a C compiler will be needed
\& h \- Hybrid, written in perl with optional C code, no compiler needed
\& + \- C++ and perl, a C++ compiler will be needed
\& o \- perl and another language other than C or C++
\&
\& I \- Interface Style
\& f \- plain Functions, no references used
\& h \- hybrid, object and function interfaces available
\& n \- no interface at all (huh?)
\& r \- some use of unblessed References or ties
\& O \- Object oriented using blessed references and/or inheritance
\&
\& P \- Public License
\& p \- Standard\-Perl: user may choose between GPL and Artistic
\& g \- GPL: GNU General Public License
\& l \- LGPL: "GNU Lesser General Public License" (previously known as
\& "GNU Library General Public License")
\& b \- BSD: The BSD License
\& a \- Artistic license alone
\& 2 \- Artistic license 2.0 or later
\& o \- open source: approved by www.opensource.org
\& d \- allows distribution without restrictions
\& r \- restricted distribution
\& n \- no license at all
.Ve
.IP "CPAN::Module::force($method,@args)" 4
.IX Item "CPAN::Module::force($method,@args)"
Forces \s-1CPAN\s0 to perform a task it would normally refuse to
do. Force takes as arguments a method name to be invoked and any number
of additional arguments to pass that method.
The internals of the object get the needed changes so that \s-1CPAN\s0.pm
does not refuse to take the action. See also the section above on the
\&\f(CW\*(C`force\*(C'\fR and the \f(CW\*(C`fforce\*(C'\fR pragma.
.IP "\fBCPAN::Module::get()\fR" 4
.IX Item "CPAN::Module::get()"
Runs a get on the distribution associated with this module.
.IP "\fBCPAN::Module::inst_file()\fR" 4
.IX Item "CPAN::Module::inst_file()"
Returns the filename of the module found in \f(CW@INC\fR. The first file found
is reported, just as perl itself stops searching \f(CW@INC\fR once it finds a
module.
.IP "\fBCPAN::Module::available_file()\fR" 4
.IX Item "CPAN::Module::available_file()"
Returns the filename of the module found in \s-1PERL5LIB\s0 or \f(CW@INC\fR. The
first file found is reported. The advantage of this method over
\&\f(CW\*(C`inst_file\*(C'\fR is that modules that have been tested but not yet
installed are included because \s-1PERL5LIB\s0 keeps track of tested modules.
.IP "\fBCPAN::Module::inst_version()\fR" 4
.IX Item "CPAN::Module::inst_version()"
Returns the version number of the installed module in readable format.
.IP "\fBCPAN::Module::available_version()\fR" 4
.IX Item "CPAN::Module::available_version()"
Returns the version number of the available module in readable format.
.IP "\fBCPAN::Module::install()\fR" 4
.IX Item "CPAN::Module::install()"
Runs an \f(CW\*(C`install\*(C'\fR on the distribution associated with this module.
.IP "\fBCPAN::Module::look()\fR" 4
.IX Item "CPAN::Module::look()"
Changes to the directory where the distribution associated with this
module has been unpacked and opens a subshell there. Exiting the
subshell returns.
.IP "\fBCPAN::Module::make()\fR" 4
.IX Item "CPAN::Module::make()"
Runs a \f(CW\*(C`make\*(C'\fR on the distribution associated with this module.
.IP "\fBCPAN::Module::manpage_headline()\fR" 4
.IX Item "CPAN::Module::manpage_headline()"
If module is installed, peeks into the module's manpage, reads the
headline, and returns it. Moreover, if the module has been downloaded
within this session, does the equivalent on the downloaded module even
if it hasn't been installed yet.
.IP "\fBCPAN::Module::perldoc()\fR" 4
.IX Item "CPAN::Module::perldoc()"
Runs a \f(CW\*(C`perldoc\*(C'\fR on this module.
.IP "\fBCPAN::Module::readme()\fR" 4
.IX Item "CPAN::Module::readme()"
Runs a \f(CW\*(C`readme\*(C'\fR on the distribution associated with this module.
.IP "\fBCPAN::Module::reports()\fR" 4
.IX Item "CPAN::Module::reports()"
Calls the \fBreports()\fR method on the associated distribution object.
.IP "\fBCPAN::Module::test()\fR" 4
.IX Item "CPAN::Module::test()"
Runs a \f(CW\*(C`test\*(C'\fR on the distribution associated with this module.
.IP "\fBCPAN::Module::uptodate()\fR" 4
.IX Item "CPAN::Module::uptodate()"
Returns 1 if the module is installed and up-to-date.
.IP "\fBCPAN::Module::userid()\fR" 4
.IX Item "CPAN::Module::userid()"
Returns the author's \s-1ID\s0 of the module.
.SS "Cache Manager"
.IX Subsection "Cache Manager"
Currently the cache manager only keeps track of the build directory
($CPAN::Config\->{build_dir}). It is a simple \s-1FIFO\s0 mechanism that
deletes complete directories below \f(CW\*(C`build_dir\*(C'\fR as soon as the size of
all directories there gets bigger than \f(CW$CPAN::Config\fR\->{build_cache}
(in \s-1MB\s0). The contents of this cache may be used for later
re-installations that you intend to do manually, but will never be
trusted by \s-1CPAN\s0 itself. This is due to the fact that the user might
use these directories for building modules on different architectures.
.PP
There is another directory ($CPAN::Config\->{keep_source_where}) where
the original distribution files are kept. This directory is not
covered by the cache manager and must be controlled by the user. If
you choose to have the same directory as build_dir and as
keep_source_where directory, then your sources will be deleted with
the same fifo mechanism.
.SS "Bundles"
.IX Subsection "Bundles"
A bundle is just a perl module in the namespace Bundle:: that does not
define any functions or methods. It usually only contains documentation.
.PP
It starts like a perl module with a package declaration and a \f(CW$VERSION\fR
variable. After that the pod section looks like any other pod with the
only difference being that \fIone special pod section\fR exists starting with
(verbatim):
.PP
.Vb 1
\& =head1 CONTENTS
.Ve
.PP
In this pod section each line obeys the format
.PP
.Vb 1
\& Module_Name [Version_String] [\- optional text]
.Ve
.PP
The only required part is the first field, the name of a module
(e.g. Foo::Bar, i.e. \fInot\fR the name of the distribution file). The rest
of the line is optional. The comment part is delimited by a dash just
as in the man page header.
.PP
The distribution of a bundle should follow the same convention as
other distributions.
.PP
Bundles are treated specially in the \s-1CPAN\s0 package. If you say 'install
Bundle::Tkkit' (assuming such a bundle exists), \s-1CPAN\s0 will install all
the modules in the \s-1CONTENTS\s0 section of the pod. You can install your
own Bundles locally by placing a conformant Bundle file somewhere into
your \f(CW@INC\fR path. The \fBautobundle()\fR command which is available in the
shell interface does that for you by including all currently installed
modules in a snapshot bundle file.
.SH "PREREQUISITES"
.IX Header "PREREQUISITES"
The \s-1CPAN\s0 program is trying to depend on as little as possible so the
user can use it in hostile environment. It works better the more goodies
the environment provides. For example if you try in the \s-1CPAN\s0 shell
.PP
.Vb 1
\& install Bundle::CPAN
.Ve
.PP
or
.PP
.Vb 1
\& install Bundle::CPANxxl
.Ve
.PP
you will find the shell more convenient than the bare shell before.
.PP
If you have a local mirror of \s-1CPAN\s0 and can access all files with
\&\*(L"file:\*(R" URLs, then you only need a perl later than perl5.003 to run
this module. Otherwise Net::FTP is strongly recommended. \s-1LWP\s0 may be
required for non-UNIX systems, or if your nearest \s-1CPAN\s0 site is
associated with a \s-1URL\s0 that is not \f(CW\*(C`ftp:\*(C'\fR.
.PP
If you have neither Net::FTP nor \s-1LWP,\s0 there is a fallback mechanism
implemented for an external ftp command or for an external lynx
command.
.SH "UTILITIES"
.IX Header "UTILITIES"
.SS "Finding packages and \s-1VERSION\s0"
.IX Subsection "Finding packages and VERSION"
This module presumes that all packages on \s-1CPAN\s0
.IP "\(bu" 2
declare their \f(CW$VERSION\fR variable in an easy to parse manner. This
prerequisite can hardly be relaxed because it consumes far too much
memory to load all packages into the running program just to determine
the \f(CW$VERSION\fR variable. Currently all programs that are dealing with
version use something like this
.Sp
.Vb 2
\& perl \-MExtUtils::MakeMaker \-le \e
\& \*(Aqprint MM\->parse_version(shift)\*(Aq filename
.Ve
.Sp
If you are author of a package and wonder if your \f(CW$VERSION\fR can be
parsed, please try the above method.
.IP "\(bu" 2
come as compressed or gzipped tarfiles or as zip files and contain a
\&\f(CW\*(C`Makefile.PL\*(C'\fR or \f(CW\*(C`Build.PL\*(C'\fR (well, we try to handle a bit more, but
with little enthusiasm).
.SS "Debugging"
.IX Subsection "Debugging"
Debugging this module is more than a bit complex due to interference from
the software producing the indices on \s-1CPAN,\s0 the mirroring process on \s-1CPAN,\s0
packaging, configuration, synchronicity, and even (gasp!) due to bugs
within the \s-1CPAN\s0.pm module itself.
.PP
For debugging the code of \s-1CPAN\s0.pm itself in interactive mode, some
debugging aid can be turned on for most packages within
\&\s-1CPAN\s0.pm with one of
.IP "o debug package..." 2
.IX Item "o debug package..."
sets debug mode for packages.
.IP "o debug \-package..." 2
.IX Item "o debug -package..."
unsets debug mode for packages.
.IP "o debug all" 2
.IX Item "o debug all"
turns debugging on for all packages.
.IP "o debug number" 2
.IX Item "o debug number"
.PP
which sets the debugging packages directly. Note that \f(CW\*(C`o debug 0\*(C'\fR
turns debugging off.
.PP
What seems a successful strategy is the combination of \f(CW\*(C`reload
cpan\*(C'\fR and the debugging switches. Add a new debug statement while
running in the shell and then issue a \f(CW\*(C`reload cpan\*(C'\fR and see the new
debugging messages immediately without losing the current context.
.PP
\&\f(CW\*(C`o debug\*(C'\fR without an argument lists the valid package names and the
current set of packages in debugging mode. \f(CW\*(C`o debug\*(C'\fR has built-in
completion support.
.PP
For debugging of \s-1CPAN\s0 data there is the \f(CW\*(C`dump\*(C'\fR command which takes
the same arguments as make/test/install and outputs each object's
Data::Dumper dump. If an argument looks like a perl variable and
contains one of \f(CW\*(C`$\*(C'\fR, \f(CW\*(C`@\*(C'\fR or \f(CW\*(C`%\*(C'\fR, it is \fBeval()\fRed and fed to
Data::Dumper directly.
.SS "Floppy, Zip, Offline Mode"
.IX Subsection "Floppy, Zip, Offline Mode"
\&\s-1CPAN\s0.pm works nicely without network access, too. If you maintain machines
that are not networked at all, you should consider working with \f(CW\*(C`file:\*(C'\fR
URLs. You'll have to collect your modules somewhere first. So
you might use \s-1CPAN\s0.pm to put together all you need on a networked
machine. Then copy the \f(CW$CPAN::Config\fR\->{keep_source_where} (but not
\&\f(CW$CPAN::Config\fR\->{build_dir}) directory on a floppy. This floppy is kind
of a personal \s-1CPAN. CPAN\s0.pm on the non-networked machines works nicely
with this floppy. See also below the paragraph about CD-ROM support.
.SS "Basic Utilities for Programmers"
.IX Subsection "Basic Utilities for Programmers"
.IP "has_inst($module)" 2
.IX Item "has_inst($module)"
Returns true if the module is installed. Used to load all modules into
the running \s-1CPAN\s0.pm that are considered optional. The config variable
\&\f(CW\*(C`dontload_list\*(C'\fR intercepts the \f(CW\*(C`has_inst()\*(C'\fR call such
that an optional module is not loaded despite being available. For
example, the following command will prevent \f(CW\*(C`YAML.pm\*(C'\fR from being
loaded:
.Sp
.Vb 1
\& cpan> o conf dontload_list push YAML
.Ve
.Sp
See the source for details.
.IP "use_inst($module)" 2
.IX Item "use_inst($module)"
Similary to \fBhas_inst()\fR tries to load optional library but also dies if
library is not available
.IP "has_usable($module)" 2
.IX Item "has_usable($module)"
Returns true if the module is installed and in a usable state. Only
useful for a handful of modules that are used internally. See the
source for details.
.IP "instance($module)" 2
.IX Item "instance($module)"
The constructor for all the singletons used to represent modules,
distributions, authors, and bundles. If the object already exists, this
method returns the object; otherwise, it calls the constructor.
.IP "\fBfrontend()\fR" 2
.IX Item "frontend()"
.PD 0
.IP "frontend($new_frontend)" 2
.IX Item "frontend($new_frontend)"
.PD
Getter/setter for frontend object. Method just allows to subclass \s-1CPAN\s0.pm.
.SH "SECURITY"
.IX Header "SECURITY"
There's no strong security layer in \s-1CPAN\s0.pm. \s-1CPAN\s0.pm helps you to
install foreign, unmasked, unsigned code on your machine. We compare
to a checksum that comes from the net just as the distribution file
itself. But we try to make it easy to add security on demand:
.SS "Cryptographically signed modules"
.IX Subsection "Cryptographically signed modules"
Since release 1.77, \s-1CPAN\s0.pm has been able to verify cryptographically
signed module distributions using Module::Signature. The \s-1CPAN\s0 modules
can be signed by their authors, thus giving more security. The simple
unsigned \s-1MD5\s0 checksums that were used before by \s-1CPAN\s0 protect mainly
against accidental file corruption.
.PP
You will need to have Module::Signature installed, which in turn
requires that you have at least one of Crypt::OpenPGP module or the
command-line \fIgpg\fR tool installed.
.PP
You will also need to be able to connect over the Internet to the public
key servers, like pgp.mit.edu, and their port 11731 (the \s-1HKP\s0 protocol).
.PP
The configuration parameter check_sigs is there to turn signature
checking on or off.
.SH "EXPORT"
.IX Header "EXPORT"
Most functions in package \s-1CPAN\s0 are exported by default. The reason
for this is that the primary use is intended for the cpan shell or for
one-liners.
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
When the \s-1CPAN\s0 shell enters a subshell via the look command, it sets
the environment \s-1CPAN_SHELL_LEVEL\s0 to 1, or increments that variable if it is
already set.
.PP
When \s-1CPAN\s0 runs, it sets the environment variable \s-1PERL5_CPAN_IS_RUNNING\s0
to the \s-1ID\s0 of the running process. It also sets
\&\s-1PERL5_CPANPLUS_IS_RUNNING\s0 to prevent runaway processes which could
happen with older versions of Module::Install.
.PP
When running \f(CW\*(C`perl Makefile.PL\*(C'\fR, the environment variable
\&\f(CW\*(C`PERL5_CPAN_IS_EXECUTING\*(C'\fR is set to the full path of the
\&\f(CW\*(C`Makefile.PL\*(C'\fR that is being executed. This prevents runaway processes
with newer versions of Module::Install.
.PP
When the config variable ftp_passive is set, all downloads will be run
with the environment variable \s-1FTP_PASSIVE\s0 set to this value. This is
in general a good idea as it influences both Net::FTP and \s-1LWP\s0 based
connections. The same effect can be achieved by starting the cpan
shell with this environment variable set. For Net::FTP alone, one can
also always set passive mode by running libnetcfg.
.SH "POPULATE AN INSTALLATION WITH LOTS OF MODULES"
.IX Header "POPULATE AN INSTALLATION WITH LOTS OF MODULES"
Populating a freshly installed perl with one's favorite modules is pretty
easy if you maintain a private bundle definition file. To get a useful
blueprint of a bundle definition file, the command autobundle can be used
on the \s-1CPAN\s0 shell command line. This command writes a bundle definition
file for all modules installed for the current perl
interpreter. It's recommended to run this command once only, and from then
on maintain the file manually under a private name, say
Bundle/my_bundle.pm. With a clever bundle file you can then simply say
.PP
.Vb 1
\& cpan> install Bundle::my_bundle
.Ve
.PP
then answer a few questions and go out for coffee (possibly
even in a different city).
.PP
Maintaining a bundle definition file means keeping track of two
things: dependencies and interactivity. \s-1CPAN\s0.pm sometimes fails on
calculating dependencies because not all modules define all MakeMaker
attributes correctly, so a bundle definition file should specify
prerequisites as early as possible. On the other hand, it's
annoying that so many distributions need some interactive configuring. So
what you can try to accomplish in your private bundle file is to have the
packages that need to be configured early in the file and the gentle
ones later, so you can go out for coffee after a few minutes and leave \s-1CPAN\s0.pm
to churn away unattended.
.SH "WORKING WITH CPAN.pm BEHIND FIREWALLS"
.IX Header "WORKING WITH CPAN.pm BEHIND FIREWALLS"
Thanks to Graham Barr for contributing the following paragraphs about
the interaction between perl, and various firewall configurations. For
further information on firewalls, it is recommended to consult the
documentation that comes with the \fIncftp\fR program. If you are unable to
go through the firewall with a simple Perl setup, it is likely
that you can configure \fIncftp\fR so that it works through your firewall.
.SS "Three basic types of firewalls"
.IX Subsection "Three basic types of firewalls"
Firewalls can be categorized into three basic types.
.IP "http firewall" 4
.IX Item "http firewall"
This is when the firewall machine runs a web server, and to access the
outside world, you must do so via that web server. If you set environment
variables like http_proxy or ftp_proxy to values beginning with http://,
or in your web browser you've proxy information set, then you know
you are running behind an http firewall.
.Sp
To access servers outside these types of firewalls with perl (even for
ftp), you need \s-1LWP\s0 or HTTP::Tiny.
.IP "ftp firewall" 4
.IX Item "ftp firewall"
This where the firewall machine runs an ftp server. This kind of
firewall will only let you access ftp servers outside the firewall.
This is usually done by connecting to the firewall with ftp, then
entering a username like \*(L"user@outside.host.com\*(R".
.Sp
To access servers outside these type of firewalls with perl, you
need Net::FTP.
.IP "One-way visibility" 4
.IX Item "One-way visibility"
One-way visibility means these firewalls try to make themselves
invisible to users inside the firewall. An \s-1FTP\s0 data connection is
normally created by sending your \s-1IP\s0 address to the remote server and then
listening for the return connection. But the remote server will not be able to
connect to you because of the firewall. For these types of firewall,
\&\s-1FTP\s0 connections need to be done in a passive mode.
.Sp
There are two that I can think off.
.RS 4
.IP "\s-1SOCKS\s0" 4
.IX Item "SOCKS"
If you are using a \s-1SOCKS\s0 firewall, you will need to compile perl and link
it with the \s-1SOCKS\s0 library. This is what is normally called a 'socksified'
perl. With this executable you will be able to connect to servers outside
the firewall as if it were not there.
.IP "\s-1IP\s0 Masquerade" 4
.IX Item "IP Masquerade"
This is when the firewall implemented in the kernel (via \s-1NAT,\s0 or networking
address translation), it allows you to hide a complete network behind one
\&\s-1IP\s0 address. With this firewall no special compiling is needed as you can
access hosts directly.
.Sp
For accessing ftp servers behind such firewalls you usually need to
set the environment variable \f(CW\*(C`FTP_PASSIVE\*(C'\fR or the config variable
ftp_passive to a true value.
.RE
.RS 4
.RE
.SS "Configuring lynx or ncftp for going through a firewall"
.IX Subsection "Configuring lynx or ncftp for going through a firewall"
If you can go through your firewall with e.g. lynx, presumably with a
command such as
.PP
.Vb 1
\& /usr/local/bin/lynx \-pscott:tiger
.Ve
.PP
then you would configure \s-1CPAN\s0.pm with the command
.PP
.Vb 1
\& o conf lynx "/usr/local/bin/lynx \-pscott:tiger"
.Ve
.PP
That's all. Similarly for ncftp or ftp, you would configure something
like
.PP
.Vb 1
\& o conf ncftp "/usr/bin/ncftp \-f /home/scott/ncftplogin.cfg"
.Ve
.PP
Your mileage may vary...
.SH "FAQ"
.IX Header "FAQ"
.IP "1)" 4
.IX Item "1)"
I installed a new version of module X but \s-1CPAN\s0 keeps saying,
I have the old version installed
.Sp
Probably you \fBdo\fR have the old version installed. This can
happen if a module installs itself into a different directory in the
\&\f(CW@INC\fR path than it was previously installed. This is not really a
\&\s-1CPAN\s0.pm problem, you would have the same problem when installing the
module manually. The easiest way to prevent this behaviour is to add
the argument \f(CW\*(C`UNINST=1\*(C'\fR to the \f(CW\*(C`make install\*(C'\fR call, and that is why
many people add this argument permanently by configuring
.Sp
.Vb 1
\& o conf make_install_arg UNINST=1
.Ve
.IP "2)" 4
.IX Item "2)"
So why is UNINST=1 not the default?
.Sp
Because there are people who have their precise expectations about who
may install where in the \f(CW@INC\fR path and who uses which \f(CW@INC\fR array. In
fine tuned environments \f(CW\*(C`UNINST=1\*(C'\fR can cause damage.
.IP "3)" 4
.IX Item "3)"
I want to clean up my mess, and install a new perl along with
all modules I have. How do I go about it?
.Sp
Run the autobundle command for your old perl and optionally rename the
resulting bundle file (e.g. Bundle/mybundle.pm), install the new perl
with the Configure option prefix, e.g.
.Sp
.Vb 1
\& ./Configure \-Dprefix=/usr/local/perl\-5.6.78.9
.Ve
.Sp
Install the bundle file you produced in the first step with something like
.Sp
.Vb 1
\& cpan> install Bundle::mybundle
.Ve
.Sp
and you're done.
.IP "4)" 4
.IX Item "4)"
When I install bundles or multiple modules with one command
there is too much output to keep track of.
.Sp
You may want to configure something like
.Sp
.Vb 2
\& o conf make_arg "| tee \-ai /root/.cpan/logs/make.out"
\& o conf make_install_arg "| tee \-ai /root/.cpan/logs/make_install.out"
.Ve
.Sp
so that \s-1STDOUT\s0 is captured in a file for later inspection.
.IP "5)" 4
.IX Item "5)"
I am not root, how can I install a module in a personal directory?
.Sp
As of \s-1CPAN 1.9463,\s0 if you do not have permission to write the default perl
library directories, \s-1CPAN\s0's configuration process will ask you whether
you want to bootstrap , which makes keeping a personal
perl library directory easy.
.Sp
Another thing you should bear in mind is that the \s-1UNINST\s0 parameter can
be dangerous when you are installing into a private area because you
might accidentally remove modules that other people depend on that are
not using the private area.
.IP "6)" 4
.IX Item "6)"
How to get a package, unwrap it, and make a change before building it?
.Sp
Have a look at the \f(CW\*(C`look\*(C'\fR (!) command.
.IP "7)" 4
.IX Item "7)"
I installed a Bundle and had a couple of fails. When I
retried, everything resolved nicely. Can this be fixed to work
on first try?
.Sp
The reason for this is that \s-1CPAN\s0 does not know the dependencies of all
modules when it starts out. To decide about the additional items to
install, it just uses data found in the \s-1META\s0.yml file or the generated
Makefile. An undetected missing piece breaks the process. But it may
well be that your Bundle installs some prerequisite later than some
depending item and thus your second try is able to resolve everything.
Please note, \s-1CPAN\s0.pm does not know the dependency tree in advance and
cannot sort the queue of things to install in a topologically correct
order. It resolves perfectly well \fBif\fR all modules declare the
prerequisites correctly with the \s-1PREREQ_PM\s0 attribute to MakeMaker or
the \f(CW\*(C`requires\*(C'\fR stanza of Module::Build. For bundles which fail and
you need to install often, it is recommended to sort the Bundle
definition file manually.
.IP "8)" 4
.IX Item "8)"
In our intranet, we have many modules for internal use. How
can I integrate these modules with \s-1CPAN\s0.pm but without uploading
the modules to \s-1CPAN\s0?
.Sp
Have a look at the CPAN::Site module.
.IP "9)" 4
.IX Item "9)"
When I run \s-1CPAN\s0's shell, I get an error message about things in my
\&\f(CW\*(C`/etc/inputrc\*(C'\fR (or \f(CW\*(C`~/.inputrc\*(C'\fR) file.
.Sp
These are readline issues and can only be fixed by studying readline
configuration on your architecture and adjusting the referenced file
accordingly. Please make a backup of the \f(CW\*(C`/etc/inputrc\*(C'\fR or \f(CW\*(C`~/.inputrc\*(C'\fR
and edit them. Quite often harmless changes like uppercasing or
lowercasing some arguments solves the problem.
.IP "10)" 4
.IX Item "10)"
Some authors have strange characters in their names.
.Sp
Internally \s-1CPAN\s0.pm uses the \s-1UTF\-8\s0 charset. If your terminal is
expecting \s-1ISO\-8859\-1\s0 charset, a converter can be activated by setting
term_is_latin to a true value in your config file. One way of doing so
would be
.Sp
.Vb 1
\& cpan> o conf term_is_latin 1
.Ve
.Sp
If other charset support is needed, please file a bug report against
\&\s-1CPAN\s0.pm at rt.cpan.org and describe your needs. Maybe we can extend
the support or maybe \s-1UTF\-8\s0 terminals become widely available.
.Sp
Note: this config variable is deprecated and will be removed in a
future version of \s-1CPAN\s0.pm. It will be replaced with the conventions
around the family of \f(CW$LANG\fR and \f(CW$LC_\fR* environment variables.
.IP "11)" 4
.IX Item "11)"
When an install fails for some reason and then I correct the error
condition and retry, \s-1CPAN\s0.pm refuses to install the module, saying
\&\f(CW\*(C`Already tried without success\*(C'\fR.
.Sp
Use the force pragma like so
.Sp
.Vb 1
\& force install Foo::Bar
.Ve
.Sp
Or you can use
.Sp
.Vb 1
\& look Foo::Bar
.Ve
.Sp
and then \f(CW\*(C`make install\*(C'\fR directly in the subshell.
.IP "12)" 4
.IX Item "12)"
How do I install a \*(L"\s-1DEVELOPER RELEASE\*(R"\s0 of a module?
.Sp
By default, \s-1CPAN\s0 will install the latest non-developer release of a
module. If you want to install a dev release, you have to specify the
partial path starting with the author id to the tarball you wish to
install, like so:
.Sp
.Vb 1
\& cpan> install KWILLIAMS/Module\-Build\-0.27_07.tar.gz
.Ve
.Sp
Note that you can use the \f(CW\*(C`ls\*(C'\fR command to get this path listed.
.IP "13)" 4
.IX Item "13)"
How do I install a module and all its dependencies from the commandline,
without being prompted for anything, despite my \s-1CPAN\s0 configuration
(or lack thereof)?
.Sp
\&\s-1CPAN\s0 uses ExtUtils::MakeMaker's \fBprompt()\fR function to ask its questions, so
if you set the \s-1PERL_MM_USE_DEFAULT\s0 environment variable, you shouldn't be
asked any questions at all (assuming the modules you are installing are
nice about obeying that variable as well):
.Sp
.Vb 1
\& % PERL_MM_USE_DEFAULT=1 perl \-MCPAN \-e \*(Aqinstall My::Module\*(Aq
.Ve
.IP "14)" 4
.IX Item "14)"
How do I create a Module::Build based Build.PL derived from an
ExtUtils::MakeMaker focused Makefile.PL?
.Sp
http://search.cpan.org/dist/Module\-Build\-Convert/
.IP "15)" 4
.IX Item "15)"
I'm frequently irritated with the \s-1CPAN\s0 shell's inability to help me
select a good mirror.
.Sp
\&\s-1CPAN\s0 can now help you select a \*(L"good\*(R" mirror, based on which ones have the
lowest 'ping' round-trip times. From the shell, use the command 'o conf init
urllist' and allow \s-1CPAN\s0 to automatically select mirrors for you.
.Sp
Beyond that help, the urllist config parameter is yours. You can add and remove
sites at will. You should find out which sites have the best up-to-dateness,
bandwidth, reliability, etc. and are topologically close to you. Some people
prefer fast downloads, others up-to-dateness, others reliability. You decide
which to try in which order.
.Sp
Henk P. Penning maintains a site that collects data about \s-1CPAN\s0 sites:
.Sp
.Vb 1
\& http://mirrors.cpan.org/
.Ve
.Sp
Also, feel free to play with experimental features. Run
.Sp
.Vb 1
\& o conf init randomize_urllist ftpstats_period ftpstats_size
.Ve
.Sp
and choose your favorite parameters. After a few downloads running the
\&\f(CW\*(C`hosts\*(C'\fR command will probably assist you in choosing the best mirror
sites.
.IP "16)" 4
.IX Item "16)"
Why do I get asked the same questions every time I start the shell?
.Sp
You can make your configuration changes permanent by calling the
command \f(CW\*(C`o conf commit\*(C'\fR. Alternatively set the \f(CW\*(C`auto_commit\*(C'\fR
variable to true by running \f(CW\*(C`o conf init auto_commit\*(C'\fR and answering
the following question with yes.
.IP "17)" 4
.IX Item "17)"
Older versions of \s-1CPAN\s0.pm had the original root directory of all
tarballs in the build directory. Now there are always random
characters appended to these directory names. Why was this done?
.Sp
The random characters are provided by File::Temp and ensure that each
module's individual build directory is unique. This makes running
\&\s-1CPAN\s0.pm in concurrent processes simultaneously safe.
.IP "18)" 4
.IX Item "18)"
Speaking of the build directory. Do I have to clean it up myself?
.Sp
You have the choice to set the config variable \f(CW\*(C`scan_cache\*(C'\fR to
\&\f(CW\*(C`never\*(C'\fR. Then you must clean it up yourself. The other possible
values, \f(CW\*(C`atstart\*(C'\fR and \f(CW\*(C`atexit\*(C'\fR clean up the build directory when you
start (or more precisely, after the first extraction into the build
directory) or exit the \s-1CPAN\s0 shell, respectively. If you never start up
the \s-1CPAN\s0 shell, you probably also have to clean up the build directory
yourself.
.IP "19)" 4
.IX Item "19)"
How can I switch to sudo instead of local::lib?
.Sp
The following 5 environment veriables need to be reset to the previous
values: \s-1PATH, PERL5LIB, PERL_LOCAL_LIB_ROOT, PERL_MB_OPT, PERL_MM_OPT\s0;
and these two \s-1CPAN\s0.pm config variables must be reconfigured:
make_install_make_command and mbuild_install_build_command. The five
env variables have probably been overwritten in your \f(CW$HOME\fR/.bashrc or
some equivalent. You either find them there and delete their traces
and logout/login or you override them temporarily, depending on your
exact desire. The two cpanpm config variables can be set with:
.Sp
.Vb 1
\& o conf init /install_.*_command/
.Ve
.Sp
probably followed by
.Sp
.Vb 1
\& o conf commit
.Ve
.SH "COMPATIBILITY"
.IX Header "COMPATIBILITY"
.SS "\s-1OLD PERL VERSIONS\s0"
.IX Subsection "OLD PERL VERSIONS"
\&\s-1CPAN\s0.pm is regularly tested to run under 5.005 and assorted
newer versions. It is getting more and more difficult to get the
minimal prerequisites working on older perls. It is close to
impossible to get the whole Bundle::CPAN working there. If you're in
the position to have only these old versions, be advised that \s-1CPAN\s0 is
designed to work fine without the Bundle::CPAN installed.
.PP
To get things going, note that GBARR/Scalar\-List\-Utils\-1.18.tar.gz is
compatible with ancient perls and that File::Temp is listed as a
prerequisite but \s-1CPAN\s0 has reasonable workarounds if it is missing.
.SS "\s-1CPANPLUS\s0"
.IX Subsection "CPANPLUS"
This module and its competitor, the \s-1CPANPLUS\s0 module, are both much
cooler than the other. \s-1CPAN\s0.pm is older. \s-1CPANPLUS\s0 was designed to be
more modular, but it was never intended to be compatible with \s-1CPAN\s0.pm.
.SS "\s-1CPANMINUS\s0"
.IX Subsection "CPANMINUS"
In the year 2010 App::cpanminus was launched as a new approach to a
cpan shell with a considerably smaller footprint. Very cool stuff.
.SH "SECURITY ADVICE"
.IX Header "SECURITY ADVICE"
This software enables you to upgrade software on your computer and so
is inherently dangerous because the newly installed software may
contain bugs and may alter the way your computer works or even make it
unusable. Please consider backing up your data before every upgrade.
.SH "BUGS"
.IX Header "BUGS"
Please report bugs via
.PP
Before submitting a bug, please make sure that the traditional method
of building a Perl module package from a shell by following the
installation instructions of that package still works in your
environment.
.SH "AUTHOR"
.IX Header "AUTHOR"
Andreas Koenig \f(CW\*(C`\*(C'\fR
.SH "LICENSE"
.IX Header "LICENSE"
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
.PP
See
.SH "TRANSLATIONS"
.IX Header "TRANSLATIONS"
Kawai,Takanori provides a Japanese translation of a very old version
of this manpage at
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Many people enter the \s-1CPAN\s0 shell by running the cpan utility
program which is installed in the same directory as perl itself. So if
you have this directory in your \s-1PATH\s0 variable (or some equivalent in
your operating system) then typing \f(CW\*(C`cpan\*(C'\fR in a console window will
work for you as well. Above that the utility provides several
commandline shortcuts.
.PP
melezhik (Alexey) sent me a link where he published a chef recipe to
work with \s-1CPAN\s0.pm: http://community.opscode.com/cookbooks/cpan.