.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Pod::Man 3perl"
.TH Pod::Man 3perl "2018-06-10" "perl v5.20.2" "Perl Programmers Reference Guide"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Pod::Man \- Convert POD data to formatted *roff input
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& use Pod::Man;
\& my $parser = Pod::Man\->new (release => $VERSION, section => 8);
\&
\& # Read POD from STDIN and write to STDOUT.
\& $parser\->parse_file (\e*STDIN);
\&
\& # Read POD from file.pod and write to file.1.
\& $parser\->parse_from_file (\*(Aqfile.pod\*(Aq, \*(Aqfile.1\*(Aq);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Pod::Man is a module to convert documentation in the \s-1POD\s0 format (the
preferred language for documenting Perl) into *roff input using the man
macro set. The resulting *roff code is suitable for display on a terminal
using \fInroff\fR\|(1), normally via \fIman\fR\|(1), or printing using \fItroff\fR\|(1).
It is conventionally invoked using the driver script \fBpod2man\fR, but it can
also be used directly.
.PP
As a derived class from Pod::Simple, Pod::Man supports the same methods and
interfaces. See Pod::Simple for all the details.
.PP
\&\fInew()\fR can take options, in the form of key/value pairs that control the
behavior of the parser. See below for details.
.PP
If no options are given, Pod::Man uses the name of the input file with any
trailing \f(CW\*(C`.pod\*(C'\fR, \f(CW\*(C`.pm\*(C'\fR, or \f(CW\*(C`.pl\*(C'\fR stripped as the man page title, to
section 1 unless the file ended in \f(CW\*(C`.pm\*(C'\fR in which case it defaults to
section 3, to a centered title of \*(L"User Contributed Perl Documentation\*(R", to
a centered footer of the Perl version it is run with, and to a left-hand
footer of the modification date of its input (or the current date if given
\&\f(CW\*(C`STDIN\*(C'\fR for input).
.PP
Pod::Man assumes that your *roff formatters have a fixed-width font named
\&\f(CW\*(C`CW\*(C'\fR. If yours is called something else (like \f(CW\*(C`CR\*(C'\fR), use the \f(CW\*(C`fixed\*(C'\fR
option to specify it. This generally only matters for troff output for
printing. Similarly, you can set the fonts used for bold, italic, and
bold italic fixed-width output.
.PP
Besides the obvious pod conversions, Pod::Man also takes care of
formatting \fIfunc()\fR, \fIfunc\fR\|(3), and simple variable references like \f(CW$foo\fR or
\&\f(CW@bar\fR so you don't have to use code escapes for them; complex expressions
like \f(CW$fred{\*(Aqstuff\*(Aq}\fR will still need to be escaped, though. It also
translates dashes that aren't used as hyphens into en dashes, makes long
dashes\*(--like this\*(--into proper em dashes, fixes \*(L"paired quotes,\*(R" makes \*(C+
look right, puts a little space between double underscores, makes \s-1ALLCAPS\s0
a teeny bit smaller in \fBtroff\fR, and escapes stuff that *roff treats as
special so that you don't have to.
.PP
The recognized options to \fInew()\fR are as follows. All options take a single
argument.
.IP "center" 4
.IX Item "center"
Sets the centered page header to use instead of \*(L"User Contributed Perl
Documentation\*(R".
.IP "date" 4
.IX Item "date"
Sets the left-hand footer. If this option is not set, the contents of the
environment variable \s-1POD_MAN_DATE,\s0 if set, will be used. Failing that,
the modification date of the input file will be used, or the current time
if \fIstat()\fR can't find that file (which will be the case if the input is
from \f(CW\*(C`STDIN\*(C'\fR). If obtained from the file modification date or the
current time, he date will be formatted as \f(CW\*(C`YYYY\-MM\-DD\*(C'\fR.
.IP "errors" 4
.IX Item "errors"
How to report errors. \f(CW\*(C`die\*(C'\fR says to throw an exception on any \s-1POD\s0
formatting error. \f(CW\*(C`stderr\*(C'\fR says to report errors on standard error, but
not to throw an exception. \f(CW\*(C`pod\*(C'\fR says to include a \s-1POD ERRORS\s0 section
in the resulting documentation summarizing the errors. \f(CW\*(C`none\*(C'\fR ignores
\&\s-1POD\s0 errors entirely, as much as possible.
.Sp
The default is \f(CW\*(C`pod\*(C'\fR.
.IP "fixed" 4
.IX Item "fixed"
The fixed-width font to use for verbatim text and code. Defaults to
\&\f(CW\*(C`CW\*(C'\fR. Some systems may want \f(CW\*(C`CR\*(C'\fR instead. Only matters for \fBtroff\fR
output.
.IP "fixedbold" 4
.IX Item "fixedbold"
Bold version of the fixed-width font. Defaults to \f(CW\*(C`CB\*(C'\fR. Only matters
for \fBtroff\fR output.
.IP "fixeditalic" 4
.IX Item "fixeditalic"
Italic version of the fixed-width font (actually, something of a misnomer,
since most fixed-width fonts only have an oblique version, not an italic
version). Defaults to \f(CW\*(C`CI\*(C'\fR. Only matters for \fBtroff\fR output.
.IP "fixedbolditalic" 4
.IX Item "fixedbolditalic"
Bold italic (probably actually oblique) version of the fixed-width font.
Pod::Man doesn't assume you have this, and defaults to \f(CW\*(C`CB\*(C'\fR. Some
systems (such as Solaris) have this font available as \f(CW\*(C`CX\*(C'\fR. Only matters
for \fBtroff\fR output.
.IP "name" 4
.IX Item "name"
Set the name of the manual page. Without this option, the manual name is
set to the uppercased base name of the file being converted unless the
manual section is 3, in which case the path is parsed to see if it is a Perl
module path. If it is, a path like \f(CW\*(C`.../lib/Pod/Man.pm\*(C'\fR is converted into
a name like \f(CW\*(C`Pod::Man\*(C'\fR. This option, if given, overrides any automatic
determination of the name.
.IP "nourls" 4
.IX Item "nourls"
Normally, L<> formatting codes with a \s-1URL\s0 but anchor text are formatted
to show both the anchor text and the \s-1URL. \s0 In other words:
.Sp
.Vb 1
\& L
.Ve
.Sp
is formatted as:
.Sp
.Vb 1
\& foo
.Ve
.Sp
This option, if set to a true value, suppresses the \s-1URL\s0 when anchor text
is given, so this example would be formatted as just \f(CW\*(C`foo\*(C'\fR. This can
produce less cluttered output in cases where the URLs are not particularly
important.
.IP "quotes" 4
.IX Item "quotes"
Sets the quote marks used to surround C<> text. If the value is a
single character, it is used as both the left and right quote; if it is two
characters, the first character is used as the left quote and the second as
the right quoted; and if it is four characters, the first two are used as
the left quote and the second two as the right quote.
.Sp
This may also be set to the special value \f(CW\*(C`none\*(C'\fR, in which case no quote
marks are added around C<> text (but the font is still changed for troff
output).
.IP "release" 4
.IX Item "release"
Set the centered footer. By default, this is the version of Perl you run
Pod::Man under. Note that some system an macro sets assume that the
centered footer will be a modification date and will prepend something like
\&\*(L"Last modified: \*(R"; if this is the case, you may want to set \f(CW\*(C`release\*(C'\fR to
the last modified date and \f(CW\*(C`date\*(C'\fR to the version number.
.IP "section" 4
.IX Item "section"
Set the section for the \f(CW\*(C`.TH\*(C'\fR macro. The standard section numbering
convention is to use 1 for user commands, 2 for system calls, 3 for
functions, 4 for devices, 5 for file formats, 6 for games, 7 for
miscellaneous information, and 8 for administrator commands. There is a lot
of variation here, however; some systems (like Solaris) use 4 for file
formats, 5 for miscellaneous information, and 7 for devices. Still others
use 1m instead of 8, or some mix of both. About the only section numbers
that are reliably consistent are 1, 2, and 3.
.Sp
By default, section 1 will be used unless the file ends in \f(CW\*(C`.pm\*(C'\fR in which
case section 3 will be selected.
.IP "stderr" 4
.IX Item "stderr"
Send error messages about invalid \s-1POD\s0 to standard error instead of
appending a \s-1POD ERRORS\s0 section to the generated *roff output. This is
equivalent to setting \f(CW\*(C`errors\*(C'\fR to \f(CW\*(C`stderr\*(C'\fR if \f(CW\*(C`errors\*(C'\fR is not already
set. It is supported for backward compatibility.
.IP "utf8" 4
.IX Item "utf8"
By default, Pod::Man produces the most conservative possible *roff output
to try to ensure that it will work with as many different *roff
implementations as possible. Many *roff implementations cannot handle
non-ASCII characters, so this means all non-ASCII characters are converted
either to a *roff escape sequence that tries to create a properly accented
character (at least for troff output) or to \f(CW\*(C`X\*(C'\fR.
.Sp
If this option is set, Pod::Man will instead output \s-1UTF\-8. \s0 If your *roff
implementation can handle it, this is the best output format to use and
avoids corruption of documents containing non-ASCII characters. However,
be warned that *roff source with literal \s-1UTF\-8\s0 characters is not supported
by many implementations and may even result in segfaults and other bad
behavior.
.Sp
Be aware that, when using this option, the input encoding of your \s-1POD\s0
source must be properly declared unless it is US-ASCII or Latin\-1. \s-1POD\s0
input without an \f(CW\*(C`=encoding\*(C'\fR command will be assumed to be in Latin\-1,
and if it's actually in \s-1UTF\-8,\s0 the output will be double-encoded. See
\&\fIperlpod\fR\|(1) for more information on the \f(CW\*(C`=encoding\*(C'\fR command.
.PP
The standard Pod::Simple method \fIparse_file()\fR takes one argument naming the
\&\s-1POD\s0 file to read from. By default, the output is sent to \f(CW\*(C`STDOUT\*(C'\fR, but
this can be changed with the \fIoutput_fh()\fR method.
.PP
The standard Pod::Simple method \fIparse_from_file()\fR takes up to two
arguments, the first being the input file to read \s-1POD\s0 from and the second
being the file to write the formatted output to.
.PP
You can also call \fIparse_lines()\fR to parse an array of lines or
\&\fIparse_string_document()\fR to parse a document already in memory. As with
\&\fIparse_file()\fR, \fIparse_lines()\fR and \fIparse_string_document()\fR default to sending
their output to \f(CW\*(C`STDOUT\*(C'\fR unless changed with the \fIoutput_fh()\fR method.
.PP
To put the output from any parse method into a string instead of a file
handle, call the \fIoutput_string()\fR method instead of \fIoutput_fh()\fR.
.PP
See Pod::Simple for more specific details on the methods available to
all derived parsers.
.SH "DIAGNOSTICS"
.IX Header "DIAGNOSTICS"
.ie n .IP "roff font should be 1 or 2 chars, not ""%s""" 4
.el .IP "roff font should be 1 or 2 chars, not ``%s''" 4
.IX Item "roff font should be 1 or 2 chars, not %s"
(F) You specified a *roff font (using \f(CW\*(C`fixed\*(C'\fR, \f(CW\*(C`fixedbold\*(C'\fR, etc.) that
wasn't either one or two characters. Pod::Man doesn't support *roff fonts
longer than two characters, although some *roff extensions do (the
canonical versions of \fBnroff\fR and \fBtroff\fR don't either).
.ie n .IP "Invalid errors setting ""%s""" 4
.el .IP "Invalid errors setting ``%s''" 4
.IX Item "Invalid errors setting %s"
(F) The \f(CW\*(C`errors\*(C'\fR parameter to the constructor was set to an unknown value.
.ie n .IP "Invalid quote specification ""%s""" 4
.el .IP "Invalid quote specification ``%s''" 4
.IX Item "Invalid quote specification %s"
(F) The quote specification given (the \f(CW\*(C`quotes\*(C'\fR option to the
constructor) was invalid. A quote specification must be one, two, or four
characters long.
.IP "\s-1POD\s0 document had syntax errors" 4
.IX Item "POD document had syntax errors"
(F) The \s-1POD\s0 document being formatted had syntax errors and the \f(CW\*(C`errors\*(C'\fR
option was set to \f(CW\*(C`die\*(C'\fR.
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
.IP "\s-1POD_MAN_DATE\s0" 4
.IX Item "POD_MAN_DATE"
If set, this will be used as the value of the left-hand footer unless the
\&\f(CW\*(C`date\*(C'\fR option is explicitly set, overriding the timestamp of the input
file or the current time. This is primarily useful to ensure reproducible
builds of the same output file given the same souce and Pod::Man version,
even when file timestamps may not be consistent.
.SH "BUGS"
.IX Header "BUGS"
Encoding handling assumes that PerlIO is available and does not work
properly if it isn't. The \f(CW\*(C`utf8\*(C'\fR option is therefore not supported
unless Perl is built with PerlIO support.
.PP
There is currently no way to turn off the guesswork that tries to format
unmarked text appropriately, and sometimes it isn't wanted (particularly
when using \s-1POD\s0 to document something other than Perl). Most of the work
toward fixing this has now been done, however, and all that's still needed
is a user interface.
.PP
The \s-1NAME\s0 section should be recognized specially and index entries emitted
for everything in that section. This would have to be deferred until the
next section, since extraneous things in \s-1NAME\s0 tends to confuse various man
page processors. Currently, no index entries are emitted for anything in
\&\s-1NAME.\s0
.PP
Pod::Man doesn't handle font names longer than two characters. Neither do
most \fBtroff\fR implementations, but \s-1GNU\s0 troff does as an extension. It would
be nice to support as an option for those who want to use it.
.PP
The preamble added to each output file is rather verbose, and most of it
is only necessary in the presence of non-ASCII characters. It would
ideally be nice if all of those definitions were only output if needed,
perhaps on the fly as the characters are used.
.PP
Pod::Man is excessively slow.
.SH "CAVEATS"
.IX Header "CAVEATS"
If Pod::Man is given the \f(CW\*(C`utf8\*(C'\fR option, the encoding of its output file
handle will be forced to \s-1UTF\-8\s0 if possible, overriding any existing
encoding. This will be done even if the file handle is not created by
Pod::Man and was passed in from outside. This maintains consistency
regardless of \s-1PERL_UNICODE\s0 and other settings.
.PP
The handling of hyphens and em dashes is somewhat fragile, and one may get
the wrong one under some circumstances. This should only matter for
\&\fBtroff\fR output.
.PP
When and whether to use small caps is somewhat tricky, and Pod::Man doesn't
necessarily get it right.
.PP
Converting neutral double quotes to properly matched double quotes doesn't
work unless there are no formatting codes between the quote marks. This
only matters for troff output.
.SH "AUTHOR"
.IX Header "AUTHOR"
Russ Allbery , based \fIvery\fR heavily on the original
\&\fBpod2man\fR by Tom Christiansen . The modifications to
work with Pod::Simple instead of Pod::Parser were originally contributed by
Sean Burke (but I've since hacked them beyond recognition and all bugs are
mine).
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010, 2012, 2013 Russ Allbery .
.PP
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Pod::Simple, \fIperlpod\fR\|(1), \fIpod2man\fR\|(1), \fInroff\fR\|(1), \fItroff\fR\|(1),
\&\fIman\fR\|(1), \fIman\fR\|(7)
.PP
Ossanna, Joseph F., and Brian W. Kernighan. \*(L"Troff User's Manual,\*(R"
Computing Science Technical Report No. 54, \s-1AT&T\s0 Bell Laboratories. This is
the best documentation of standard \fBnroff\fR and \fBtroff\fR. At the time of
this writing, it's available at
.
.PP
The man page documenting the man macro set may be \fIman\fR\|(5) instead of
\&\fIman\fR\|(7) on your system. Also, please see \fIpod2man\fR\|(1) for extensive
documentation on writing manual pages if you've not done it before and
aren't familiar with the conventions.
.PP
The current version of this module is always available from its web site at
. It is also part of the
Perl core distribution as of 5.6.0.