Chapter 21. Contributing to CPAN

Besides allowing others in our organization to receive the benefits of these wonderful modules and distributions we’ve created, we can contribute to the Perl community at large. The mechanism for sharing your work is the Comprehensive Perl Archive Network (CPAN), which is almost 20 years old as we write this and has over 100,000 different modules.

The Comprehensive Perl Archive Network

We covered the basic CPAN mechanics in Chapter 2, but that was from a user’s perspective. Now we want to contribute to CPAN, so we have to look at it from an author’s perspective.

It’s no accident that CPAN is so useful. The ethos of the project has been that anyone should be able to contribute and that it should be easy for people to share their work. The unofficial CPAN motto is “upload early, upload often.” We don’t have to finish our code to start sharing it with others.

Remember that CPAN is a big storage device. That’s its magic. Everything else that revolves around it, such as MetaCPAN (https://www.metacpan.org/), CPAN.pm, and CPANPLUS, merely uses what’s already there; there’s no need for creation.

Getting Prepared

Since CPAN is a big file storage site, we need to upload our distribution. To contribute to CPAN, we need two things:

  • Something to contribute, ideally already in the shape of a module

  • A Perl Authors Upload Server (PAUSE) account

The PAUSE account is our passport to contributing to CPAN. We get a PAUSE account simply by asking.[63]

Get Intermediate Perl, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.