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
10
votes
3 answers

What are your tricks for speeding up CPAN on limited resource devices?

I was recently trying to upgrade a few Perl modules on my cell phone (nokia n900), and installing the latest copy of Module::Build for an hour. Most of the time (70%) seemed to be spent parsing and indexing the repository information. It seems…
Eric Strom
  • 39,821
  • 2
  • 80
  • 152
10
votes
4 answers

Giving Credit for Perl Module

I wrote a script for my company and I am using some libraries I obtained from CPAN. My manager wanted me to consolidate and remove the extra libraries - which is a little funny because I include them for the script to work. A few notes: I do not…
rusty
  • 307
  • 1
  • 4
  • 16
10
votes
4 answers

How can I avoid sudo-ing when installing Perl modules with 'cpan'?

I have installed Perl from source into /usr/local, and adjusted my path accordingly, following brian d foy's suggestion here. I'm sure I'm missing something, but, now I'm trying to install stuff with the 'cpan' command and it's failing because it…
AmbroseChapel
  • 11,957
  • 7
  • 46
  • 68
10
votes
3 answers

Can't locate local/lib.pm in @INC at /usr/share/perl/5.14/CPAN/FirstTime.pm

I am trying to use Perl the first time on my system which is Ubuntu 12.04. I have Perl v.5.14.2 installed. I looked up how to install Perl modules, so I started as follows: $ perl -MCPAN -e shell The wizard started configuring the environment as…
JJD
  • 50,076
  • 60
  • 203
  • 339
9
votes
3 answers

Config file handling in Perl

There are plenty of Modules in the Config:: Namespace on CPAN, but they are all limited in ond way or another. I'm currently using Config::Std, which is fine most of the time, however it makes certain things difficult: more than two levels of…
tex
  • 2,051
  • 1
  • 23
  • 27
9
votes
2 answers

Cwd.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)

All Perl modules and 'cpan' stopped working after an upgrade of Ubuntu 16.04 LTS to 18.04 LTS. Every time I run my script it leads to the error threads.c: loadable library and Perl binaries are mismatched (got handshake key 0xdb00080, needed…
Pradyumna Sagar
  • 365
  • 3
  • 10
9
votes
4 answers

What is the recommended way of doing date arithmetics in Perl?

What is the recommended way of doing date arithmetics in Perl? Say for example that I want to know the date three days ago from today (where today = 2010-10-17 and today - 3 days = 2010-10-13). How would you do that in Perl?
knorv
  • 49,059
  • 74
  • 210
  • 294
9
votes
4 answers

How could I find files that use certain modules in CPAN?

Some modules on CPAN are excellently documented, others.... not so much, but it's usually easy to discern how to use a module via prior art (e.g modules/tests that used the module you're looking to use). I'm wondering what the best way is to find…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
9
votes
4 answers

What's the proper way of obtaining an account on CPAN?

Can you please tell me the steps I need to follow in order to obtain an account on CPAN? I'd like to contribute some modules. A while back, I tried to create an account, and I remember I got back a mail containing some of this text: The following…
Geo
  • 93,257
  • 117
  • 344
  • 520
9
votes
8 answers

Separating configuration data and script logic in Perl scripts

I find the following anti-pattern repeated in my Perl scripts: the script contains some machine/setup specific settings which I store in-line as constants in the script whereas the rest of the script is general in nature: #!/usr/bin/perl use…
knorv
  • 49,059
  • 74
  • 210
  • 294
9
votes
1 answer

Does every Perl module in a distribution need to have a version number?

I'm maintaining a CPAN distribution that has over 100 .pm files. Do each of them need to have a $VERSION, or is it okay to just include it in the main module? For the other modules in the distribution, what effect does including or not including…
Steve Simms
  • 826
  • 5
  • 5
9
votes
2 answers

How can I 'use' specific version of a perl CPAN module?

I have a lot perl code that does different things in test and production, and I want to lock my code to specific versions of CPAN modules in case there are some changes to some of them in the future which may possibly break my code. So I want to…
Gogi
  • 1,695
  • 4
  • 23
  • 36
8
votes
3 answers

How to tell CPAN about path to make and cc

Running Perl 5.10 CPAN on Solaris with opencsw.org packages, Makefile.PL from packages can't find the correct path and cc (gcc). I found the path to make and set it to gmake, but I can't find any setting for cc. I thought I once set this in…
Lawrence I. Siden
  • 9,191
  • 10
  • 43
  • 56
8
votes
2 answers

How do I tell CPAN.pm to install all modules in a specific directory?

I have set makepl_arg [INSTALLDIRS=site PREFIX=~/perl] mbuildpl_arg [--install_base ~/perl] in the CPAN.pm configuration. I had hoped that this would cause modules to get installed in the same place, but I still have to set multiple…
Chas. Owens
  • 64,182
  • 22
  • 135
  • 226
8
votes
5 answers

How do I set up a local CPAN mirror?

What do I need to set up and maintain a local CPAN mirror? What scripts and best practices should I be aware of?
Nick Gerakines
  • 1,432
  • 1
  • 11
  • 20