PERL hat ein eigenes extrem einfaches Dokumentationsformat mit Namen "POD".
"POD" bedeutet "Plain old Documentation" und lässt sich sich als kleinster gemeinsamer Nenner der Dokumentationsformate "nroff/troff", "man", "latex", "tex","text","html" und möglicherweise auch noch weiterer Formate beschreiben. Wer eines dieser Formate nur ansatzweise versteht wird mit POD keine Mühe haben.
Der POD Code wid einfach im PERL-Code untergebracht, zum Beispiel in einem Helloworld-Programm
(helloworld1.pl):
#!/usr/bin/perl -w
=pod
=head1 NAME
helloworld1.pl
=head1 SYNOPSIS
helloworld1.pl
perl helloworld1.pl [options]
=head1 DESCRIPTION
prints out a simple hello World
=head1 AUTHOR Rainer Zufall I<rainer.zufall@chance.com>
=cut
#
# perl code
#
print "hello world";
Der PERL-Compiler ignoriert die POD-Anweisungen, aber der Befehl
perldoc helloworld1.pl produziert direkt aus dem Code
eine Manpage für das helloworld.
Um aus dem Quellcode Dokumentation in anderen Formaten zu erzeugen stehen außer
perldoc noch einige andere Formatierer zur Verfgung: pod2hpp, pod2html, pod2latex, pod2man, pod2text> und pod2usage .
Im obigen Beispiel wurden folgende POD-Kommandos verwendet:
=pod signalisiert dem PERL-Compiler
dass jetzt POD-Code folgt der bei der Compilation ignoriert werden soll.
=cut signalisiert das Ende des POD-Codes=head1 signalisiert, das jetzt ein Header erster Ordnung folgt,
(außerdem gibt es noch Header 2ter Ordung, die mit =head2 eingeleitet werden) I<...>
Mehr über das POD-Format (und die restlichen Formatierungstags)
liefert die Online-Hile mit dem Kommando: perldoc perlpod.
Mit perldoc steht unter PERL eine umfangreiche online-Hilfe zur Verfügung, von der wir
bis jetzt schon reichlich Gebrauch gemacht haben.
Weil dank POD PERL-Code und Dokumentation eine Einheit bilden kann man sich sofort nach der Installation
eines Modules mit dem Kommando perldoc <modulname> dessen Dokumentation ansehen.
Von dieser Möglichkeit haben wir bis jetzt reichlichen Gebrauch gemacht.
Darüberhinaus stehen noch eine Reihe von hervorragenden Dokumenten über einzelne
Aspekte der PERL-Programmierung zur Verfügung die mit der Standarddokumentation
ausgeliefert werden. Das Kommando perldoc perl liefert unter PERL 5.004
eine Liste von 43 Dokumenten:
Perl changes since previous version
Perl changes in version 5.004
Perl frequently asked questions
Perl documentation table of contents
Perl data structures
Perl syntax
Perl operators and precedence
Perl regular expressions
Perl execution and options
Perl builtin functions
Perl open() tutorial
Perl predefined variables
Perl subroutines
Perl modules: how they work
Perl modules: how to write and use
Perl modules: how to install from CPAN
Perl formats
Perl locale support
Perl references
Perl references short introduction
Perl data structures intro
Perl data structures: lists of lists
Perl OO tutorial
Perl objects
Perl objects hidden behind simple variables
Perl OO tricks and examples
Perl interprocess communication
Perl threads tutorial
Perl debugging
Perl diagnostic messages
Perl security
Perl traps for the unwary
Perl portability guide
Perl style guide
Perl plain old documentation
Perl book information
Perl ways to embed perl in your C or C++ application
Perl internal IO abstraction interface
Perl XS application programming interface
Perl XS tutorial
Perl internal functions for those doing extensions
Perl calling conventions from C
Perl history records