How do I get started writing a module for CPAN?

The best place to start is the CPAN FAQ.

As noted there, the following are good resources:

  • perldoc perlmod
  • perldoc perlmodlib

As always, the PerlMonks are a good resource as well. See their "How to make a CPAN Module Distribution".


I usually start with Module::Starter. It comes with a pretty simple command-line tool that will create a new distribution from a template, including all the necessary files and a t/ directory, and so on. It will also produce either a Makefile.PL (using ExtUtils::MakeMaker) or a Build.PL (using Module::Build.)

It also places an empty .pm file there with templates in place for your POD and such.

Tags:

Perl

Cpan