26.2. Pod Translators and Modules
Perl is bundled with several pod translators that convert pod documents (or the embedded pod in other types of documents) into various formats. All should be 8-bit clean.
Additional translators are available on CPAN for other formats.
Translators exhibit different default behaviors depending on the output format. For instance, if your pod has a prose paragraph saying:
then pod2html will turn that into:This is a $variable right here
but pod2text will leave it unadorned, since the dollar should be enough to let it be read.This is a <STRONG>$variable</STRONG> right here
You should write your pod as close to plain text as you possibly can, with as few explicit markups as you can get away with. It is up to the individual translator to decide how things in your text should be represented. That means letting the translator figure out how to create paired quotes, how to fill and adjust text, how to find a smaller font for words in all capitals, etc. Since these were written to process Perl documentation, most translators should also recognize unadorned items like these and render them appropriately:
Perl also comes with several standard modules for parsing and converting pod, including Pod::Checker (and the associated podchecker utility) for checking the syntax of pod documents, Pod::Find for finding pod documents in directory trees, and Pod::Parser for creating your own pod utilities.
Note that pod translators should only look at paragraphs beginning with a pod directive (this makes parsing easier), whereas the compiler actually knows to look for pod escapes even in the middle of a paragraph. This means that the following secret stuff will be ignored by both the compiler and the translators.
You probably shouldn't rely upon the warn being podded out forever. Not all pod translators are well-behaved in this regard, and the compiler may someday become pickier.$a=3; =secret stuff warn "Neither POD nor CODE!?" =cut back print "got $a\n";
Copyright © 2002 O'Reilly & Associates. All rights reserved.