Search code examples
perlcpan

How do I get started writing a module for CPAN?


Right now, I have my own homegrown testing harness/directory structure/support doc strucure/distribution tools for my libraries. However, reading the blog post Write your code like it's going on CPAN, it sounded like a good idea. Then it occurred to me, I'm really not sure how to do that.

What are some good resources to get started making your own Perl packages in the CPAN-like structure?


Solution

  • 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.