Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
CPAN
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Perl module software repository}} [[File:The logo of CPAN.png|thumb|CPAN logo]] The '''Comprehensive Perl Archive Network''' ('''CPAN''') is a [[software repository]] of over 220,000 [[Modular programming|software modules]] and accompanying documentation for 45,500 distributions, written in the [[Perl]] [[programming language]] by over 14,500 contributors.<ref name="home">{{Cite web |title=CPAN front page|url=http://www.cpan.org/|access-date=2 February 2025}}</ref> ''CPAN'' can denote either the archive network or the Perl program that acts as an interface to the network and as an automated software installer (somewhat like a [[package manager]]). Most software on CPAN is [[free and open source software]].<ref>{{cite web |url=http://www.cpan.org/misc/cpan-faq.html#How_is_Perl_licensed |title=How are Perl and the CPAN modules licensed? |quote=Most, though not all, modules on CPAN are licensed under the GNU General Public License (GPL) or the Artistic license... }}</ref> ==History== CPAN was conceived in 1993 and has been active online since October 1995.<ref>{{cite web |url=http://history.perl.org/PerlTimeline.html |title=The Timeline of Perl and its Culture}}</ref> It is based on the [[CTAN]] model and began as a place to unify the structure of scattered Perl archives.<ref>{{cite web|title=Grokking the CPAN|url=http://www.cpan.org/authors/id/H/HF/HFB/grok-cpan-1.01.pdf|quote= I propose that we cooperate to create a unified structure, much like the CTAN project which has managed to create a collection of canonical sites for TeX}}</ref> ==Role== Like many [[programming language]]s, Perl has mechanisms to use external [[library (computing)|libraries]] of code, making one file contain common routines used by several programs. Perl calls these ''modules''. [[Perl module]]s are typically installed in one of several [[directory (computing)|directories]] whose [[path (computing)|paths]] are placed in the Perl [[interpreter (computing)|interpreter]] when it is first [[compiler|compiled]]; on [[Unix-like]] [[operating system]]s, common paths include ''/usr/lib/perl5'', ''/usr/local/lib/perl5'', and several of their subdirectories. Perl comes with a small set of ''core modules''. Some of these perform bootstrapping tasks, such as ExtUtils::MakeMaker,<ref>{{Cite web|title=ExtUtils::MakeMaker - Create a module Makefile - Perldoc Browser|url=https://perldoc.perl.org/ExtUtils::MakeMaker|access-date=2020-11-18|website=perldoc.perl.org}}</ref> which is used to create [[Makefile]]s for building and installing other extension modules; others, like List::Util,<ref>{{Cite web|title=List::Util - A selection of general-utility list subroutines - Perldoc Browser|url=https://perldoc.perl.org/List::Util|access-date=2020-11-18|website=perldoc.perl.org}}</ref> are merely commonly used. CPAN's main purpose is to help programmers locate modules and programs not included in the Perl standard distribution. Its structure is decentralized. Authors maintain and improve their own modules. Forking, and creating competing modules for the same task or purpose, is common. There is a third-party bug tracking system that is automatically set up for any uploaded distribution, but authors may opt to use a different bug tracking system such as [[GitHub]]. Similarly, though GitHub is a popular location to store the source for distributions, it may be stored anywhere the author prefers, or may not be publicly accessible at all. Maintainers may grant permissions to others to maintain or take over their modules, and permissions may be granted by admins for those wishing to take over abandoned modules. Previous versions of updated distributions are retained on CPAN until deleted by the uploader, and a secondary mirror network called BackPAN retains distributions even if they are deleted from CPAN.<ref>{{cite web |title=BackPAN |url=http://backpan.cpantesters.org/ |access-date=20 December 2019}}</ref> Also, the complete history of the CPAN and all its modules is available as the GitPAN project,<ref name="gitpan-readme">{{cite web|url=https://github.com/evalEmpire/gitpan/blob/master/README.md|date=2 December 2015|access-date=16 November 2016|title=What is Gitpan?|website=[[GitHub]]}}</ref> allowing to easily see the complete history for all the modules and for easy maintenance of forks. CPAN is also used to distribute new versions of Perl, as well as related projects, such as [[Parrot virtual machine|Parrot]] and [[Raku (programming language)|Raku]]. ==Structure== Files on the CPAN are referred to as ''distributions''. A distribution may consist of one or more modules, documentation files, or programs packaged in a common archiving format, such as a [[gzip]]ped [[tar file format|tar]] archive or a [[ZIP file format|ZIP]] file. Distributions will often contain installation scripts (usually called ''Makefile.PL'' or ''Build.PL'') and test scripts which can be run to verify the contents of the distribution are functioning properly. New distributions are uploaded to the Perl Authors Upload Server, or PAUSE (see the section [[#Uploading distributions with PAUSE|Uploading distributions with PAUSE]]). In 2003, distributions started to include metadata files, called ''META.[[YAML|yml]]'', indicating the distribution's name, version, dependencies, and other useful information; however, not all distributions contain metadata. When metadata is not present in a distribution, the PAUSE's software will try to analyze the code in the distribution to look for the same information; this is not necessarily very reliable. In 2010, version 2 of this specification was created<ref>{{cite web |title=CPAN::Meta::History |url=https://metacpan.org/pod/CPAN::Meta::History |access-date=20 December 2019}}</ref> to be used via a new file called ''META.[[json]]'', with the YAML format file often also included for [[backward compatibility]]. With thousands of distributions, CPAN needs to be structured to be useful. Authors often place their modules in the natural hierarchy of Perl module names (such as <code>Apache::DBI</code> or <code>Lingua::EN::Inflect</code>) according to purpose or domain, though this is not enforced. CPAN module distributions usually have names in the form of ''CGI-Application-3.1'' (where the '''::''' used in the module's name has been replaced with a dash, and the version number has been appended to the name), but this is only a convention; many prominent distributions break the convention, especially those that contain multiple modules. Security restrictions prevent a distribution from ever being replaced with an identical filename, so virtually all distribution names do include a [[version number]]. ==Components== The distribution infrastructure of CPAN consists of its worldwide network of more than 250 mirrors in more than 60 countries.<ref name="cpan-SITES">{{cite web|url=http://www.cpan.org/SITES.html|title=CPAN Mirror Network|access-date=16 November 2016}}</ref> Each full mirror hosts around 36 [[gigabyte]]s of data.<ref name="mirror-howto">{{cite web|url=http://www.cpan.org/misc/how-to-mirror.html|access-date=22 August 2024|title=How to mirror CPAN|publisher=CPAN.org}}</ref> Most mirrors update themselves hourly, daily or bidaily from the CPAN master site.<ref>{{cite web |url=http://www.cs.uu.nl/stats/mirmon/cpan.html|title=CPAN Status and Statistics|access-date=9 May 2010}}</ref> Some sites are major FTP servers which mirror lots of other software, but others are simply servers owned by companies that use Perl heavily. There are at least two mirrors on every continent except Antarctica. Several search engines have been written to help Perl programmers sort through the CPAN. The official {{URL|search.cpan.org}} includes textual search, a browsable index of modules, and extracted copies of all distributions currently on the CPAN. On 16 May 2018, the Perl Foundation announced that search.cpan.org would be shut down on 29 June 2018 (after 19 years of operation), due to its aging codebase and maintenance burden. Users will be transitioned and redirected to the third-party alternative MetaCPAN.<ref>{{Cite web |url=https://log.perl.org/2018/05/goodbye-search-dot-cpan-dot-org.html |title=The end of an era: Saying goodbye to search.cpan.org |website=log.perl.org |language=en |access-date=22 May 2018}}</ref><ref>{{Cite web |url=https://www.perl.com/article/saying-goodbye-to-search-cpan-org/ |title=Saying goodbye to search.cpan.org |website=perl.com |language=en |access-date=26 June 2018}}</ref> CPAN Testers are a group of volunteers, who will download and test distributions as they are uploaded to CPAN. This enables the authors to have their modules tested on many platforms and environments to which they otherwise lack access, thus improving portability, and quality. Smoke testers send reports, which are then collated and used for a variety of presentation websites, including the main reports site, statistics, and dependencies. Authors can upload new distributions to the CPAN through the ''Perl Authors Upload Server'' (PAUSE). To do so, they must request a PAUSE account. Once registered, they may use a web interface at [https://pause.perl.org pause.perl.org], or an [[File Transfer Protocol|FTP]] interface to upload files to their directory and delete them. Modules in the upload will only be indexed as canonical if the module name has not been used before (granting ''first-come'' permission to the uploader), or if the uploader has permission for that name, and if the module is a higher version than any existing entry.<ref>{{cite web |title=PAUSE Operating Model |website=[[GitHub]] |url=https://github.com/andk/pause/blob/master/doc/operating-model.md |access-date=20 December 2019}}</ref> This can be specified through PAUSE's web interface. ==CPAN.pm, CPANPLUS, and cpanminus== There is also a Perl core module named CPAN; it is usually differentiated from the repository itself by using the name CPAN.pm. CPAN.pm is mainly an interactive shell which can be used to search for, download, and install distributions. An interactive shell called {{mono|cpan}} is also provided in the Perl core, and is the usual way of running CPAN.pm. After a short configuration process and mirror selection, it uses tools available on the user's computer to automatically download, unpack, compile, test, and install modules. It can also self-update. An effort to replace CPAN.pm with something cleaner and more modern resulted in the CPANPLUS (or CPAN++) set of modules. CPANPLUS separates the back-end work of downloading, compiling, and installing modules from the interactive shell used to issue commands. It supports several advanced features, such as cryptographic signature checking, test result reporting, and uninstalling a distribution. CPANPLUS was added to the Perl core in version 5.10.0, and removed from it in version 5.20.0. A smaller, leaner modern alternative to these CPAN installers was developed called cpanminus. cpanminus was designed to have a much smaller memory footprint as often required in limited memory environments, and to be usable as a standalone script such that it can even install itself, requiring only the expected set of core Perl modules to be available. It is also available from CPAN as the module App::cpanminus, which installs the {{mono|cpanm}} script. It does not maintain or rely on a persistent configuration, but is configured only by the environment and command-line options. cpanminus does not have an interactive shell component. It recognizes the cpanfile format for specifying prerequisites, useful in ad-hoc Perl projects that may not be designed for CPAN installation. cpanminus also has the ability to uninstall distributions. Each of these modules can check a distribution's [[Coupling (computer programming)|dependencies]] and recursively install any prerequisites, either automatically or with individual user approval. Each support FTP and HTTP and can work through firewalls and proxies. ==Influence== Experienced Perl programmers often comment that half of Perl's power is in the CPAN. It has been called Perl's [[killer app]].<ref name="PERLmonks">{{cite web |title=Re: Killer Apps in PERL|url=http://www.perlmonks.org/bare/?node_id=187498 |access-date=24 February 2013}}</ref> It is roughly equivalent to [[Composer (software)|Composer]] for [[PHP]]; the [[PyPI]] (Python Package Index) repository for [[Python (programming language)|Python]]; [[RubyGems]] for [[Ruby (programming language)|Ruby]]; [[CRAN (R programming language)|CRAN]] for [[R (programming language)|R]]; [[npm (software)|npm]] for [[Node.js]]; [[LuaRocks]] for [[Lua]]; [[Apache Maven|Maven]] for [[Java (programming language)|Java]]; and [[Hackage]] for [[Haskell]]. CPAN's use of arbitrated name spaces, a testing regime and a well defined documentation style makes it unique. Given its importance to the Perl developer community, the CPAN both shapes and is shaped by [[Perl#Perl community|Perl's culture]]. Its "self-appointed master librarian", [[Jarkko Hietaniemi]], often takes part in the [[April Fools' Day]] jokes; on 1 April 2002 the site was temporarily named to ''[[CJAN]]'', where the "J" stood for "Java". In 2003, the <code>www.cpan.org</code> domain name was redirected to [[Matt's Script Archive]], a site infamous in the Perl community for having badly written code.<ref>{{cite web |title=Elements of Programming with Perl |url=http://www.perlmonks.org/?node_id=36308 |date=12 October 2000 |access-date=25 April 2013}}</ref><ref>{{cite web |title=Exploit this formmail.pl for fun and, well, fun |url=http://www.perlmonks.org/?node_id=102758 |date=7 August 2001 |access-date=25 April 2013}}</ref><ref>{{cite web |title=Matt's Script Archive Strikes Again! |url=http://www.perlmonks.org/?node_id=93731 |date=4 July 2001 |access-date=25 April 2013}}</ref> Some of the distributions on the CPAN are distributed as jokes. The <code>[[Acme Corporation|Acme]]::</code> hierarchy is reserved for joke modules; for instance, <code>Acme::Don't</code> adds a <code>don't</code> function that doesn't run the code given to it (to complement the <code>do</code> built-in, which does). Even outside the <code>Acme::</code> hierarchy, some modules are still written largely for amusement; one example is <code>Lingua::Romana::Perligata</code>, which can be used to write Perl programs in a subset of Latin. In 2005, a group of Perl developers who also had an interest in [[JavaScript]] got together to create [[JSAN]], the JavaScript Archive Network. The JSAN is a near-direct port of the CPAN infrastructure for use with the JavaScript language, which for most of its lifespan did not have a cohesive "community". In 2008, after a chance meeting with CPAN admin [[Adam Kennedy (programmer)|Adam Kennedy]] at the Open Source Developers Conference, Linux kernel developer [[Rusty Russell]] created the CCAN, the Comprehensive C Archive Network. The CCAN is a direct port of the CPAN architecture for use with the [[C (programming language)|C language]]. CRAN, the Comprehensive R Archive Network, is a set of mirrors hosting the [[R (programming language)|R language]] distribution(s), documentation, and contributed extensions.<ref>{{cite web |url=https://cran.r-project.org/doc/FAQ/R-FAQ.html#What-is-CRAN_003f |title=What is CRAN? |access-date=20 December 2019}}</ref> ==References== {{Reflist}} ==External links== {{Portal|Free and open-source software}} * {{Official website}} * [https://metacpan.org MetaCPAN] * [https://www.cpan.org/SITES.html List of official CPAN mirrors], [http://mirrors.cpan.org/ status of mirrors] * [https://www.cpan.org/misc/ZCAN.html ZCAN - "The Zen of Comprehensive Archive Networks"] - a document that aims to explain how and why CPAN succeeded and how to duplicate it in similar efforts. (9 January 2003 by [[Jarkko Hietaniemi]]). {{Perl}} {{Authority control}} {{Use dmy dates|date=December 2020}} [[Category:Perl]] [[Category:Archive networks]] [[Category:Free package management systems]] [[Category:Package management systems]]
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Authority control
(
edit
)
Template:Cite web
(
edit
)
Template:Mono
(
edit
)
Template:Official website
(
edit
)
Template:Perl
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:URL
(
edit
)
Template:Use dmy dates
(
edit
)
Search
Search
Editing
CPAN
Add topic