I've been wrangling with the lack of documentation on how to start a module that one would expect CPAN inclusion at some point. Not that the docs aren't there, but there's nothing coherent to them and are spread throughout time and space, at least in the standard perl documentation space (including info from CPAN and PAUSE). While learning by example (other CPAN modules) works, it's not always intuitive. So I am considering at least putting a tutorial or a howto together on how to go about doing this, partially for myself, and partially for the community as a whole.
Note that if you have a better reference already, please let me know, I'd rather not reinvent the wheel.
The steps, as I see it (and will be trying in the very near future) appear to go along these lines:
- Use "h2xs" to create a 'new' perl project within a new directory; if not using
any lib stubs, the -X will only create perl files. This includes Makefile.PL, README, and test.pl
- Create/move the library files into place in this new
directory, making sure to define $VERSION
- If tests are desired, either create them in test.pl, or delete test.pl, create a directory 't', and within 't', name any scripts that are part of the test suite as '*.t'.
- use "perl Makefile.PL" to create a unix-compat makefile.
- Edit README and other document files to liking.
- At this point, one has a nearly complete package; at this point, a program like CVS can be used to maintain version control.
- Use "make; make build; make test" to make sure everything works as expected, and edit as necessary.
- Use "make clean" to return to a distribution-ready directory structure.
- Distribute as necessary.
Obviously, this doesn't cover a large number of possible situations, but from what I can tell from the docs, this is sufficiently adequete for perl-only modules. Am I missing any key steps, paying too little or too much attention to certain steps, or just am thinking completely wrong about this?
Dr. Michael K. Neylon - email@example.com
"You've left the lens cap of your mind on again, Pinky" - The Brain