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
6
votes
1 answer

Is there a way to have dependencies defined by OS in a CPAN distribution?

I'm working on a CPAN distribution that can work on Win32 and *nix. However, in order for it to work on Win32, it requires another CPAN distribution (module) that can only be installed on Win32. The problem with this is that, by declaring that…
Francisco Zarabozo
  • 3,676
  • 2
  • 28
  • 54
6
votes
1 answer

latexindent: trouble installing File::HomeDir, Mac::SystemDirectory since macOS 11 Big Sur

Before I begin, I should note that I never had this problem on macOS 10.15 Catalina, and the responses in this similar thread did not solve the problem, unfortunately. I'm experimenting with latexindent on a fresh install of macOS 11 Big Sur and I'm…
Collin Sinclair
  • 453
  • 1
  • 3
  • 12
6
votes
3 answers

How do I find out the filename of a Perl package?

I would like to translate a Perl package name to the full path of the file. say package_name_to_path('Foo::Bar::Baz'); /tmp/Foo/Bar/Baz.pm I know there is a CPAN module to do this? I just can't find it again?
git-noob
  • 5,757
  • 11
  • 34
  • 32
6
votes
1 answer

Perl/CPAN how to distribute script rather than module

I just published my first perl program, unifdef+ (code::unifdefplus, v0.5.3), but I'm not sure if I've done it properly. The program is broken into two parts -- a script (script/unifdef+.pl), and a module (lib/unifdefplus.pm). The script is…
user2766918
  • 574
  • 4
  • 17
6
votes
2 answers

Why isn't my CPAN distribution indexed by PAUSE?

I've uploaded my stasis distribution to PAUSE, but it isn't in the index. I thought this was because it didn't contain a package, so I added a package declaration to the stasis script in v0.04 like this: #!/usr/bin/env perl package stasis; package…
David Farrell
  • 427
  • 6
  • 16
6
votes
2 answers

How do you read CPAN changelogs?

Since discovering perlbrew, I'm a happy CPAN user. But what I have never figured out is how to read changelogs of modules. For example, when looking at the outdated ones with "r" in the CPAN shell, I'd like to easily inspect the changelog to decide…
Thomas Kappler
  • 3,795
  • 1
  • 22
  • 21
6
votes
3 answers

Stopping Perl XS modules from silently falling back to pure-perl

It seems some (many?) modules on CPAN are partly implemented in C using XS, and can fall back to a pure-perl implementation if necessary. While this is smart, it can obviously hurt performance, and I would like to know it happens so I can fix the…
Øyvind Skaar
  • 2,278
  • 15
  • 15
6
votes
2 answers

Alien::wxWidgets install fails on OSX 10

It's basically the same as this one which didn't really ended up. I'm facing the same issue and I went a bit further. I had to change the code to allow a newer Macos sdk (10.11). So it compiled for a while but then failed whith this: ❯❯❯ perl…
guiohm
  • 101
  • 4
6
votes
2 answers

How do I set up SNI support for Mojolicious?

Perl's Mojolicious supports Server Name Identification (SNI), which some web servers use to host several sites with one HTTPS certificate. I'm working on a system that's not set up to use this, and googling a bit doesn't turn up anything that makes…
brian d foy
  • 129,424
  • 31
  • 207
  • 592
6
votes
5 answers

Is there a CPAN module to parse nested parentheses?

Is there a CPAN module that can read a string like this: "[[, ], (abc, def, ghi), ({'jkl'})]" ...and parse it into some sort of tree structure that's easy to walk and pretty-print?
mike
  • 46,876
  • 44
  • 102
  • 112
6
votes
3 answers

Is there any Perl module to set up an object from a default configuration plus a hashref of optional configurations?

I'm finding myself repeatedly writing and rewriting the following kind of code: my %default = (x => "a", y => "b"); sub new { my ($package, $config) = @_; my $self = {%default}; for my $k (keys %default) { $self->{$k}…
user181548
6
votes
1 answer

My Perl module from CPAN won't install, what do I do?

This is a canonical question for the above problem, inspired by this answer and this question. Please edit and improve it. I'm trying to install a module from CPAN, using the CPAN/cpanm/CPANPLUS client. However, I'm getting build or test errors…
dsolimano
  • 8,870
  • 3
  • 48
  • 63
6
votes
2 answers

How can I write a CPAN module to support multiple Perl versions?

Let's say I have a module on CPAN and I'd like to upgrade it to use features from newer Perls. Right now, as I understand it, if I do that I'm putting a line in the sand saying from this version on you can only use my module if you have version X…
6
votes
3 answers

How can I make Strawberry Perl's cpan(1) find perl?

I'm having trouble installing Template module with Strawberry Perl. cpan Template yields the following: Writing Makefile for AppConfig C:strawberryperlbinperl.exe: not found dmake.EXE: Error code 255, while making 'blib\lib\.exists'` I haven't…
6
votes
3 answers

How can one prevent double encoding of html entities when they are allowed in the input

How can I prevent double encoding of html entities, or fix them programmatically? I am using the encode() function from the HTML::Entities perl module to encode HTML entities in user input. The problem here is that we also allow users to input HTML…
Bob
  • 513
  • 1
  • 6
  • 9