spx2 has asked for the wisdom of the Perl Monks concerning the following question:

hello,

1)I would like to ask if there is any article I could read to learn
how to properly write docs for the modules I have.
I know the docs can be read with perldoc but what is the proper format to
write the docs in,and isn't it messy to have docs and code at the same time?
can I separate them ? or should I do it the classic way ?
2)I want to publish some modules on cpan,how do I do this ? what are the
steps to do this ?


thank you

Replies are listed 'Best First'.
Re: writing docs and publishing on cpan
by toolic (Bishop) on Jan 08, 2008 at 01:13 UTC
Re: writing docs and publishing on cpan
by Anonymous Monk on Jan 08, 2008 at 06:20 UTC

    POD (Plain Old Documentation) is the proper format to write the docs in. CPAN has a list of suggested and required sections for submitted modules and scripts. I personally keep the POD at the end of the module source code, seperate from the code itself by an __END__ statement.

    Publishing a module or script first requires a PAUSE id.
    You can read more on submitting modules to CPAN and documenting them below:

Re: writing docs and publishing on cpan
by andreas1234567 (Vicar) on Jan 08, 2008 at 07:09 UTC
    The easiest way to create a module for distribution on CPAN is probably to use Module::Starter. It will create the necessary standard components a module distribution needs:
    • MANIFEST
    • Makefile.PL
    • Build.PL
    • README
    • Changes
    • lib/
    • t/
    Install Module::Starter, then type
    module-starter --module Ping::Pong::Pang
    on the command line, and it will create a new subdirectory named Ping-Pong-Pang with all the necessary files in it.

    Do also take the time to read what other module writers have done. Create a test suite, and get your PAUSE account. Good luck.

    --
    Andreas
Re: writing docs and publishing on cpan
by msbalaji (Chaplain) on Jan 08, 2008 at 03:58 UTC

    Hi

    Please refer the book named 'Writing Perl Modules for CPAN' by Sam Tregar published by Apress

    Regards
    Balaji. M

Re: writing docs and publishing on cpan
by adiabat (Acolyte) on Jan 08, 2008 at 22:03 UTC

    Regarding documenting your modules, I'd recommend you use the newest version of Pod: Perl6-Perldoc.

    To get started, install Perl6::Perldoc, then use the included perldoc2xhtml tool to convert the S26.pod6 document from Pod to html for easy reading in your browser.