Next Previous Contents

8. PERL-Dokumentation

8.1 Das POD Format

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:

Mehr über das POD-Format (und die restlichen Formatierungstags) liefert die Online-Hile mit dem Kommando: perldoc perlpod.

8.2 perldoc

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:

perldelta

Perl changes since previous version

perl5004delta

Perl changes in version 5.004

perlfaq

Perl frequently asked questions

perltoc

Perl documentation table of contents

perldata

Perl data structures

perlsyn

Perl syntax

perlop

Perl operators and precedence

perlre

Perl regular expressions

perlrun

Perl execution and options

perlfunc

Perl builtin functions

perlopentut

Perl open() tutorial

perlvar

Perl predefined variables

perlsub

Perl subroutines

perlmod

Perl modules: how they work

perlmodlib

Perl modules: how to write and use

perlmodinstall

Perl modules: how to install from CPAN

perlform

Perl formats

perllocale

Perl locale support

perlref

Perl references

perlreftut

Perl references short introduction

perldsc

Perl data structures intro

perllol

Perl data structures: lists of lists

perltoot

Perl OO tutorial

perlobj

Perl objects

perltie

Perl objects hidden behind simple variables

perlbot

Perl OO tricks and examples

perlipc

Perl interprocess communication

perlthrtut

Perl threads tutorial

perldebug

Perl debugging

perldiag

Perl diagnostic messages

perlsec

Perl security

perltrap

Perl traps for the unwary

perlport

Perl portability guide

perlstyle

Perl style guide

perlpod

Perl plain old documentation

perlbook

Perl book information

perlembed

Perl ways to embed perl in your C or C++ application

perlapio

Perl internal IO abstraction interface

perlxs

Perl XS application programming interface

perlxstut

Perl XS tutorial

perlguts

Perl internal functions for those doing extensions

perlcall

Perl calling conventions from C

perlhist

Perl history records


Next Previous Contents