Questions tagged [cpan]

CPAN is the Comprehensive Perl Archive Network, a code and documentation archive of over 100,000 open-source Perl modules across more than 25,000 distributions written by more than 10,000 authors. This tag is not for general Perl questions; use the [perl] tag instead.

The Comprehensive Perl Archive Network (CPAN) is an open-source code and documentation archive of over 100,000 Perl modules across more than 25,000 distributions written by more than 10,000 authors.

CPAN has been online since October 1995 and is constantly growing. CPAN's main purpose is to provide a distributed repository for Perl programmers to locate, install, and share open source modules and code snippets.

Installable files on the CPAN are known as distributions. A distribution consists of one or more modules, documentation files (generally in ), or scripts. Distributions are typically packaged with an install script called Makefile.PL or Build.PL.

When to use this tag?

This tag is not for general Perl questions; use instead. This tag should be used for questions relating to cpan.org or modules for interacting with cpan.org and mirrors (like CPAN.pm ) ...

Documentation

CPAN Installation tools for end users

  • CPAN - the classic CPAN command line install shell
  • CPANPLUS - an updated API and command line interface to CPAN intended to be more scriptable
  • cpanminus - a faster and more concise CPAN installer
  • CPAN::Mini - create a minimal mirror of CPAN

Modules used for creating install/distribution scripts

  • ExtUtils::MakeMaker - the venerable module used to generate a make file via Makefile.PL.
  • Module::Install - a drop-in replacement for ExtUtils::MakeMaker that provides more intuitive features and customization for module authors
  • Module::Build - a mostly pure Perl alternative to ExtUtils::MakeMaker, which does not rely on a system make command.
  • Dist::Zilla - distribution builder
  • pip - Perl Installation Program

Related Links

1203 questions
11
votes
3 answers

How to use a CPANPLUS autobundle to update a new version of Perl?

I have Perl 5.13.4 with a large collection of installed CPAN modules. I have just compiled Perl 5.14.0. I'd like to install (recompile) all the modules in 5.13.4 into 5.14.0. I can/have generated a bundle of the installed modules with 'cpanp' and…
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
11
votes
2 answers

How do I stop CPAN from accessing an unresponsive package repository?

I tried to install a package. It's failing connecting to soft-download.org. I don't know why it's trying to connect to that host. $ cpan install Config::IniFiles Loading internal null logger. Install Log::Log4perl for logging messages CPAN:…
Chloe
  • 25,162
  • 40
  • 190
  • 357
11
votes
3 answers

A quick string checksum function in Perl generating values in the 0..2^32-1 range

I'm looking for a Perl string checksum function with the following properties: Input: Unicode string of undefined length ($string) Output: Unsigned integer ($hash), for which 0 <= $hash <= 2^32-1 holds (0 to 4294967295, matching the size of a…
knorv
  • 49,059
  • 74
  • 210
  • 294
11
votes
3 answers

ZMQ::LibZMQ3 and strawberry perl

I am trying to install ZMQ::LibZMQ3 on strawberry perl but get the below error message while installing this module also my zmq libs and includes are found under C:\Program Files\ZeroMQ 3.2.2 : cpan> install ZMQ::LibZMQ3 Running install for module…
smith
  • 3,232
  • 26
  • 55
11
votes
4 answers

Ordering array by dependencies with perl

Have an array of hashes, my @arr = get_from_somewhere(); the @arr contents (for example) is: @arr = ( { id => "id2", requires => 'someid', text => "another text2" }, { id => "xid4", requires => 'id2', text => "text44" }, { id =>…
cajwine
  • 3,100
  • 1
  • 20
  • 41
10
votes
1 answer

How should I distribute data files with Perl modules?

I've started a module-starter (with --builder=Module::Build). I want to use SQL::Library to collect my SQL into an .ini file... but in order to find the file during run time, I need to know its exact path. How do I get the path of the "data…
user1481
  • 849
  • 1
  • 5
  • 15
10
votes
2 answers

How to get started writing Perl bindings for a C++ library?

I want to write Perl bindings for a C++ library, so that the library can be used from Perl. How would I get started doing this? I've written pure-Perl modules for CPAN before.
Andreas
  • 7,470
  • 10
  • 51
  • 73
10
votes
1 answer

How can I create an RPM from a module and recursively create separate independent RPMs for the dependencies?

Given a module how can I create an rpm of not just the module, but all the module's dependencies? Start by creating a test module $ module-starter --author "Evan Carroll" --email "me@evancarroll.com" --module Foo::Bar Added to MANIFEST:…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
10
votes
2 answers

What is the difference between the core, vendor and site locations in Perl?

I recently ran into some trouble installing some modules and discovered to my surprise that many of the modules that had been installed, have duplicated installations and versions. Trying to track where stuff goes in a standard (if there is such a…
not2qubit
  • 14,531
  • 8
  • 95
  • 135
10
votes
2 answers

"make test" more verbose in Perl

When I run make test using the normal test harness that CPAN modules have, it will just output a brief summary (if all went well). t/000_basic.t .......................... ok t/001_db_handle.t ...................... ok t/002_dr_handle.t…
Thilo
  • 257,207
  • 101
  • 511
  • 656
10
votes
4 answers

Which cpan modules are the best to read and study?

I've looked into the source code of DBIx::Class recently and found that I don't understand a thing (though I mastered a couple tricks while trying to). So my question is: which CPAN modules are a must read for someone who wants to learn, and in…
Dallaylaen
  • 5,268
  • 20
  • 34
10
votes
3 answers

Best practice for using slightly modifying module from CPAN?

I'm using DBI and DBD::SQLite, and now I'd like to use the R*Tree feature of SQLite. Since this feature is not compiled by DBD::SQLite by default, I have to add a -DSQLITE_ENABLE_RTREE=1 to the @CC_DEFINE variable in DBD::SQLite's Makefile.PL. If…
cespinoza
  • 1,437
  • 1
  • 12
  • 18
10
votes
2 answers

How can I set library and include paths for Makefile.PL for a single installation?

How can I tell CPAN to give Makefile.PL one specific argument in one specific installation? Specifically. I want to install XML::LibXML, and apt-get installed the library to /usr/lib/libxml2.so.2.6.32. Makefile.PL has problems with that and tells…
Karel Bílek
  • 36,467
  • 31
  • 94
  • 149
10
votes
7 answers

Two versions of Perl in Mac OS X?

I've installed the Template module via CPAN on my MacBook Pro and it seemed to install correctly. But, when I try to run a script that includes the Template module, I get the following: Can't locate Template.pm in @INC (@INC contains:…
purinkle
  • 907
  • 2
  • 10
  • 20
10
votes
5 answers

cpan(1) fails with 'Cannot allocate memory'

I'm getting the following error 'Cannot allocate memory' when attempting to install the Moose package for Perl. Can anyone advise what is wrong here? ricky@rickyp:~$ sudo cpan install Moose Reading '/home/ricky/.cpan/Metadata' Database was…
Ricky
  • 2,850
  • 5
  • 28
  • 41