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.

pod2text

Converts pod into text. Normally, this text will be 7-bit ASCII, but it will be 8-bit if it had 8-bit input, or specifically ISO-8859-1 (or Unicode) if you use sequences like LE<uacute>thien for Lúthien or EE<auml>rendil for Eärendil.

If you have a file with pod in it, the easiest (although perhaps not the prettiest) way to view just the formatted pod would be:

% pod2text File.pm | more

Then again, pod is supposed to be human readable without formatting.

pod2man

Converts pod into Unix manpage format suitable for viewing through nroff (1) or creating typeset copies via troff (1). For example:

% pod2man File.pm | nroff -man | more

or

% pod2man File.pm | troff -man -Tps -t > tmppage.ps
% ghostview tmppage.ps

and to print:

% lpr -Ppostscript tmppage.ps
pod2html

Converts pod into HTML for use with your favorite viewer:

% pod2html File.pm > tmppage.html
% lynx tmppage.html
% netscape -remote "openURL(file:`pwd`/tmppage.html)"

That last one is a netscape hack that works if you already have netscape running somewhere to tell that incarnation to load the page. Otherwise, just call it as you did lynx.

pod2latex

Converts pod into [LaTeX].

Additional translators are available on CPAN for other formats.

Translators exhibit different default behaviors depending on the output format. For instance, if your pod ...

Get Programming Perl, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.