Skip to content

Latest commit

 

History

History
155 lines (106 loc) · 5.14 KB

cpan.pod

File metadata and controls

155 lines (106 loc) · 5.14 KB

The CPAN

Perl is a pragmatic language. If you have a problem, chances are the global Perl community has already written--and shared--code to solve it.

Modern Perl programming relies on the CPAN (http://www.cpan.org/). The Comprehensive Perl Archive Network is an uploading and mirroring system for redistributable, reusable Perl code. It's one of the largest libraries of code in the world. You can find everything from database access to profiling tools to protocols for almost every network device ever created to sound and graphics libraries and wrappers for shared libraries on your system.

Modern Perl without the CPAN is just another language. Modern Perl with the CPAN is a powerful toolkit for solving problems.

CPAN hosts distributions, or collections of reusable Perl code. A single distribution can contain one or more modules: self-contained libraries of Perl code. Each distribution occupies its own CPAN namespace and provides unique metadata.

The CPAN itself is merely a mirroring service. Authors upload distributions to a central service (PAUSE) which replicates them to mirror sites from which CPAN clients download them. All of this relies on common behavior; community standards have evolved to identify the attributes and characteristics of well-formed CPAN distributions. These include:

  • the behavior of automated CPAN installers

  • metadata to describe what each distribution provides and expects

  • machine-readable documentation and licensing

Additional CPAN services provide comprehensive automated testing and reporting across platforms and Perl versions. Every CPAN distribution has its own ticket queue on http://rt.cpan.org/ for reporting bugs and working with authors. CPAN sites also link to previous distribution versions, module ratings, documentation annotations, and more. All of this is available from both http://search.cpan.org/ and http://metacpan.org/.

Modern Perl installations include a client to connect to, search, download, build, test, and install CPAN distributions; this is CPAN.pm. With a recent version (as of this writing, 2.10 is the latest stable release), module installation is reasonably easy. Start the client with:

To install a distribution within the client:

... or to install directly from the command line:

Eric Wilhelm's tutorial on configuring CPAN.pmhttp://learnperl.scratchcomputing.com/tutorials/configuration/ includes a great troubleshooting section.

CPAN Management Tools

If your operating system provides its own Perl installation, it may be out of date or depend on specific versions of CPAN distributions. Serious Perl developers often construct virtual walls between the system Perl and their development Perl installations. Several projects help to make this possible.

The App::cpanminus CPAN client is fast and simple and needs no configuration. Install it with cpan App::cpanminus, or:

App::perlbrew is a system to manage and to switch between your own installations of multiple versions and configurations of Perl. Installation is as easy as:

The local::lib CPAN distribution allows you to install and to manage multiple Perl installations. This is an effective way to maintain CPAN distributions for individual users or applications without affecting the system as a whole. See https://metacpan.org/pod/local::lib and https://metacpan.org/pod/App::local::lib::helper for more details.

All three projects tend to assume a Unix-like environment. Windows users, see the Padre all-in-one download (http://padre.perlide.org/download.html).

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 3:

A non-empty Z<>

Around line 10:

Deleting unknown formatting code U<>

Around line 58:

Deleting unknown formatting code U<>

Deleting unknown formatting code U<>

Deleting unknown formatting code U<>

Around line 97:

Deleting unknown formatting code N<>

Deleting unknown formatting code U<>

Around line 148:

Deleting unknown formatting code U<>

Deleting unknown formatting code U<>

Around line 154:

Deleting unknown formatting code U<>