Tuesday, September 19, 2006

Documentation with Pod

Pod is a simple-to-use markup language used for writing documentation for Perl, Perl programs, and Perl modules. POD stands for Plain Old Documentation . Pod documentation can be included in perl scripts or modules.

Translators are available for converting Pod to various formats like plain text, HTML, man pages, and more.

Following commands are supported

    =head1 Heading Text
    =head2 Heading Text
    =head3 Heading Text
    =head4 Heading Text
    =over indentlevel
    =item stuff
    =back
    =cut
    =pod
    =begin format
    =end format
    =for format text

Following is an example of a pod document. To test, copy the following part into a file and run perldoc filename.

#######################################
=head1 NAME

abc.pl

=head1 DESCRIPTION

This line shows up as description. This line shows up as description. This line shows up as description. This line shows up as description.

=head1 USAGE

I< perl abc.pl >

 The script asks for 3 inputs. They are -

 * x
 * y
 * z

=head2 heading2

Try this out ! You may want to include documentation of your scripts in Pod.

=head1 AUTHOR

ketan404

=cut
###############

No comments: