Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get started writing a module for CPAN?

Tags:

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?

like image 556
Robert P Avatar asked Nov 13 '09 18:11

Robert P


2 Answers

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.

like image 68
friedo Avatar answered Oct 03 '22 04:10

friedo


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

like image 40
Tim Henigan Avatar answered Oct 03 '22 03:10

Tim Henigan