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 - firstname.lastname@example.org
"You've left the lens cap of your mind on again, Pinky" - The Brain
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||