Debian Codegraph @

upstream/opensuse-tumbleweed/man1/perlpod.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "PERLPOD 1"
61 .TH PERLPOD 1 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 perlpod \- the Plain Old Documentation format
68 .IX Xref "POD plain old documentation"
69 .SH DESCRIPTION
70 .IX Header "DESCRIPTION"
71 Pod is a simple\-to\-use markup language used for writing documentation
72 for Perl, Perl programs, and Perl modules.
73 .PP
74 Translators are available for converting Pod to various formats
75 like plain text, HTML, man pages, and more.
76 .PP
77 Pod markup consists of three basic kinds of paragraphs:
78 ordinary,
79 verbatim, and
80 command.
81 .SS "Ordinary Paragraph"
82 .IX Xref "POD, ordinary paragraph"
83 .IX Subsection "Ordinary Paragraph"
84 Most paragraphs in your documentation will be ordinary blocks
85 of text, like this one. You can simply type in your text without
86 any markup whatsoever, and with just a blank line before and
87 after. When it gets formatted, it will undergo minimal formatting,
88 like being rewrapped, probably put into a proportionally spaced
89 font, and maybe even justified.
90 .PP
91 You can use formatting codes in ordinary paragraphs, for \fBbold\fR,
92 \&\fIitalic\fR, \f(CW\*(C`code\-style\*(C'\fR, hyperlinks, and more. Such
93 codes are explained in the "Formatting Codes"
94 section, below.
95 .SS "Verbatim Paragraph"
96 .IX Xref "POD, verbatim paragraph verbatim"
97 .IX Subsection "Verbatim Paragraph"
98 Verbatim paragraphs are usually used for presenting a codeblock or
99 other text which does not require any special parsing or formatting,
100 and which shouldn\*(Aqt be wrapped.
101 .PP
102 A verbatim paragraph is distinguished by having its first character
103 be a space or a tab. (And commonly, all its lines begin with spaces
104 and/or tabs.) It should be reproduced exactly, with tabs assumed to
105 be on 8\-column boundaries. There are no special formatting codes,
106 so you can\*(Aqt italicize or anything like that. A \e means \e, and
107 nothing else.
108 .SS "Command Paragraph"
109 .IX Xref "POD, command"
110 .IX Subsection "Command Paragraph"
111 A command paragraph is used for special treatment of whole chunks
112 of text, usually as headings or parts of lists.
113 .PP
114 All command paragraphs (which are typically only one line long) start
115 with "=", followed by an identifier, followed by arbitrary text that
116 the command can use however it pleases. Currently recognized commands
117 are
118 .PP
119 .Vb 10
120 \& =pod
121 \& =head1 Heading Text
122 \& =head2 Heading Text
123 \& =head3 Heading Text
124 \& =head4 Heading Text
125 \& =head5 Heading Text
126 \& =head6 Heading Text
127 \& =over indentlevel
128 \& =item stuff
129 \& =back
130 \& =begin format
131 \& =end format
132 \& =for format text...
133 \& =encoding type
134 \& =cut
135 .Ve
136 .PP
137 To explain them each in detail:
138 .ie n .IP """=head1 \fIHeading Text\fR""" 4
139 .el .IP "\f(CW=head1 \fR\f(CIHeading Text\fR\f(CW\fR" 4
140 .IX Xref "=head1 =head2 =head3 =head4 =head5 =head6 head1 head2 head3 head4 head5 head6"
141 .IX Item "=head1 Heading Text"
142 .PD 0
143 .ie n .IP """=head2 \fIHeading Text\fR""" 4
144 .el .IP "\f(CW=head2 \fR\f(CIHeading Text\fR\f(CW\fR" 4
145 .IX Item "=head2 Heading Text"
146 .ie n .IP """=head3 \fIHeading Text\fR""" 4
147 .el .IP "\f(CW=head3 \fR\f(CIHeading Text\fR\f(CW\fR" 4
148 .IX Item "=head3 Heading Text"
149 .ie n .IP """=head4 \fIHeading Text\fR""" 4
150 .el .IP "\f(CW=head4 \fR\f(CIHeading Text\fR\f(CW\fR" 4
151 .IX Item "=head4 Heading Text"
152 .ie n .IP """=head5 \fIHeading Text\fR""" 4
153 .el .IP "\f(CW=head5 \fR\f(CIHeading Text\fR\f(CW\fR" 4
154 .IX Item "=head5 Heading Text"
155 .ie n .IP """=head6 \fIHeading Text\fR""" 4
156 .el .IP "\f(CW=head6 \fR\f(CIHeading Text\fR\f(CW\fR" 4
157 .IX Item "=head6 Heading Text"
158 .PD
159 Head1 through head6 produce headings, head1 being the highest
160 level. The text in the rest of this paragraph is the content of the
161 heading. For example:
162 .Sp
163 .Vb 1
164 \& =head2 Object Attributes
165 .Ve
166 .Sp
167 The text "Object Attributes" comprises the heading there.
168 The text in these heading commands can use formatting codes, as seen here:
169 .Sp
170 .Vb 1
171 \& =head2 Possible Values for C<$/>
172 .Ve
173 .Sp
174 Such commands are explained in the
175 "Formatting Codes" section, below.
176 .Sp
177 Note that \f(CW\*(C`head5\*(C'\fR and \f(CW\*(C`head6\*(C'\fR were introduced in 2020 and in
178 Pod::Simple 3.41, released in October 2020, so they might not be
179 supported on the Pod parser you use.
180 .ie n .IP """=over \fIindentlevel\fR""" 4
181 .el .IP "\f(CW=over \fR\f(CIindentlevel\fR\f(CW\fR" 4
182 .IX Xref "=over =item =back over item back"
183 .IX Item "=over indentlevel"
184 .PD 0
185 .ie n .IP """=item \fIstuff...\fR""" 4
186 .el .IP "\f(CW=item \fR\f(CIstuff...\fR\f(CW\fR" 4
187 .IX Item "=item stuff..."
188 .ie n .IP """=back""" 4
189 .el .IP \f(CW=back\fR 4
190 .IX Item "=back"
191 .PD
192 Item, over, and back require a little more explanation: "=over" starts
193 a region specifically for the generation of a list using "=item"
194 commands, or for indenting (groups of) normal paragraphs. At the end
195 of your list, use "=back" to end it. The \fIindentlevel\fR option to
196 "=over" indicates how far over to indent, generally in ems (where
197 one em is the width of an "M" in the document\*(Aqs base font) or roughly
198 comparable units; if there is no \fIindentlevel\fR option, it defaults
199 to four. (And some formatters may just ignore whatever \fIindentlevel\fR
200 you provide.) In the \fIstuff\fR in \f(CW\*(C`=item \fR\f(CIstuff...\fR\f(CW\*(C'\fR, you may
201 use formatting codes, as seen here:
202 .Sp
203 .Vb 1
204 \& =item Using C<$|> to Control Buffering
205 .Ve
206 .Sp
207 Such commands are explained in the
208 "Formatting Codes" section, below.
209 .Sp
210 Note also that there are some basic rules to using "=over" ...
211 "=back" regions:
212 .RS 4
213 .IP \(bu 4
214 Don\*(Aqt use "=item"s outside of an "=over" ... "=back" region.
215 .IP \(bu 4
216 The first thing after the "=over" command should be an "=item", unless
217 there aren\*(Aqt going to be any items at all in this "=over" ... "=back"
218 region.
219 .IP \(bu 4
220 Don\*(Aqt put "=head\fIn\fR" commands inside an "=over" ... "=back" region.
221 .IP \(bu 4
222 And perhaps most importantly, keep the items consistent: either use
223 "=item *" for all of them, to produce bullets; or use "=item 1.",
224 "=item 2.", etc., to produce numbered lists; or use "=item foo",
225 "=item bar", etc.\-\-namely, things that look nothing like bullets or
226 numbers. (If you have a list that contains both: 1) things that don\*(Aqt
227 look like bullets nor numbers, plus 2) things that do, you should
228 preface the bullet\- or number\-like items with \f(CW\*(C`Z<>\*(C'\fR. See
229 Z<>
230 below for an example.)
231 .Sp
232 If you start with bullets or numbers, stick with them, as
233 formatters use the first "=item" type to decide how to format the
234 list.
235 .RE
236 .RS 4
237 .RE
238 .ie n .IP """=cut""" 4
239 .el .IP \f(CW=cut\fR 4
240 .IX Xref "=cut cut"
241 .IX Item "=cut"
242 To end a Pod block, use a blank line,
243 then a line beginning with "=cut", and a blank
244 line after it. This lets Perl (and the Pod formatter) know that
245 this is where Perl code is resuming. (The blank line before the "=cut"
246 is not technically necessary, but many older Pod processors require it.)
247 .ie n .IP """=pod""" 4
248 .el .IP \f(CW=pod\fR 4
249 .IX Xref "=pod pod"
250 .IX Item "=pod"
251 The "=pod" command by itself doesn\*(Aqt do much of anything, but it
252 signals to Perl (and Pod formatters) that a Pod block starts here. A
253 Pod block starts with \fIany\fR command paragraph, so a "=pod" command is
254 usually used just when you want to start a Pod block with an ordinary
255 paragraph or a verbatim paragraph. For example:
256 .Sp
257 .Vb 1
258 \& =item stuff()
259 \&
260 \& This function does stuff.
261 \&
262 \& =cut
263 \&
264 \& sub stuff {
265 \& ...
266 \& }
267 \&
268 \& =pod
269 \&
270 \& Remember to check its return value, as in:
271 \&
272 \& stuff() || die "Couldn\*(Aqt do stuff!";
273 \&
274 \& =cut
275 .Ve
276 .ie n .IP """=begin \fIformatname\fR""" 4
277 .el .IP "\f(CW=begin \fR\f(CIformatname\fR\f(CW\fR" 4
278 .IX Xref "=begin =end =for begin end for"
279 .IX Item "=begin formatname"
280 .PD 0
281 .ie n .IP """=end \fIformatname\fR""" 4
282 .el .IP "\f(CW=end \fR\f(CIformatname\fR\f(CW\fR" 4
283 .IX Item "=end formatname"
284 .ie n .IP """=for \fIformatname\fR \fItext...\fR""" 4
285 .el .IP "\f(CW=for \fR\f(CIformatname\fR\f(CW \fR\f(CItext...\fR\f(CW\fR" 4
286 .IX Item "=for formatname text..."
287 .PD
288 For, begin, and end will let you have regions of text/code/data that
289 are not generally interpreted as normal Pod text, but are passed
290 directly to particular formatters, or are otherwise special. A
291 formatter that can use that format will use the region, otherwise it
292 will be completely ignored.
293 .Sp
294 A command "=begin \fIformatname\fR", some paragraphs, and a
295 command "=end \fIformatname\fR", mean that the text/data in between
296 is meant for formatters that understand the special format
297 called \fIformatname\fR. For example,
298 .Sp
299 .Vb 1
300 \& =begin html
301 \&
302 \& <hr> <img src="thang.png">
303 \& <p> This is a raw HTML paragraph </p>
304 \&
305 \& =end html
306 .Ve
307 .Sp
308 The command "=for \fIformatname\fR \fItext...\fR"
309 specifies that the remainder of just this paragraph (starting
310 right after \fIformatname\fR) is in that special format.
311 .Sp
312 .Vb 2
313 \& =for html <hr> <img src="thang.png">
314 \& <p> This is a raw HTML paragraph </p>
315 .Ve
316 .Sp
317 This means the same thing as the above "=begin html" ... "=end html"
318 region.
319 .Sp
320 That is, with "=for", you can have only one paragraph\*(Aqs worth
321 of text (i.e., the text in "=foo targetname text..."), but with
322 "=begin targetname" ... "=end targetname", you can have any amount
323 of stuff in between. (Note that there still must be a blank line
324 after the "=begin" command and a blank line before the "=end"
325 command.)
326 .Sp
327 Here are some examples of how to use these:
328 .Sp
329 .Vb 1
330 \& =begin html
331 \&
332 \& <br>Figure 1.<br><IMG SRC="figure1.png"><br>
333 \&
334 \& =end html
335 \&
336 \& =begin text
337 \&
338 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
339 \& | foo |
340 \& | bar |
341 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
342 \&
343 \& ^^^^ Figure 1. ^^^^
344 \&
345 \& =end text
346 .Ve
347 .Sp
348 Some format names that formatters currently are known to accept
349 include "roff", "man", "latex", "tex", "text", and "html". (Some
350 formatters will treat some of these as synonyms.)
351 .Sp
352 A format name of "comment" is common for just making notes (presumably
353 to yourself) that won\*(Aqt appear in any formatted version of the Pod
354 document:
355 .Sp
356 .Vb 2
357 \& =for comment
358 \& Make sure that all the available options are documented!
359 .Ve
360 .Sp
361 Some \fIformatnames\fR will require a leading colon (as in
362 \&\f(CW"=for :formatname"\fR, or
363 \&\f(CW"=begin :formatname" ... "=end :formatname"\fR),
364 to signal that the text is not raw data, but instead \fIis\fR Pod text
365 (i.e., possibly containing formatting codes) that\*(Aqs just not for
366 normal formatting (e.g., may not be a normal\-use paragraph, but might
367 be for formatting as a footnote).
368 .ie n .IP """=encoding \fIencodingname\fR""" 4
369 .el .IP "\f(CW=encoding \fR\f(CIencodingname\fR\f(CW\fR" 4
370 .IX Xref "=encoding encoding"
371 .IX Item "=encoding encodingname"
372 This command is used for declaring the encoding of a document. Most
373 users won\*(Aqt need this; but if your encoding isn\*(Aqt US\-ASCII,
374 then put a \f(CW\*(C`=encoding \fR\f(CIencodingname\fR\f(CW\*(C'\fR command very early in the document so
375 that pod formatters will know how to decode the document. For
376 \&\fIencodingname\fR, use a name recognized by the Encode::Supported
377 module. Some pod formatters may try to guess between a Latin\-1 or
378 CP\-1252 versus
379 UTF\-8 encoding, but they may guess wrong. It\*(Aqs best to be explicit if
380 you use anything besides strict ASCII. Examples:
381 .Sp
382 .Vb 1
383 \& =encoding latin1
384 \&
385 \& =encoding utf8
386 \&
387 \& =encoding koi8\-r
388 \&
389 \& =encoding ShiftJIS
390 \&
391 \& =encoding big5
392 .Ve
393 .Sp
394 \&\f(CW\*(C`=encoding\*(C'\fR affects the whole document, and must occur only once.
395 .PP
396 And don\*(Aqt forget, all commands but \f(CW\*(C`=encoding\*(C'\fR last up
397 until the end of its \fIparagraph\fR, not its line. So in the
398 examples below, you can see that every command needs the blank
399 line after it, to end its paragraph. (And some older Pod translators
400 may require the \f(CW\*(C`=encoding\*(C'\fR line to have a following blank line as
401 well, even though it should be legal to omit.)
402 .PP
403 Some examples of lists include:
404 .PP
405 .Vb 1
406 \& =over
407 \&
408 \& =item *
409 \&
410 \& First item
411 \&
412 \& =item *
413 \&
414 \& Second item
415 \&
416 \& =back
417 \&
418 \& =over
419 \&
420 \& =item Foo()
421 \&
422 \& Description of Foo function
423 \&
424 \& =item Bar()
425 \&
426 \& Description of Bar function
427 \&
428 \& =back
429 .Ve
430 .SS "Formatting Codes"
431 .IX Xref "POD, formatting code formatting code POD, interior sequence interior sequence"
432 .IX Subsection "Formatting Codes"
433 In ordinary paragraphs and in some command paragraphs, various
434 formatting codes (a.k.a. "interior sequences") can be used:
435 .ie n .IP """I<text>"" \-\- italic text" 4
436 .el .IP "\f(CWI<text>\fR \-\- italic text" 4
437 .IX Xref "I I<> POD, formatting code, italic italic"
438 .IX Item "I<text> -- italic text"
439 Used for emphasis ("\f(CW\*(C`be I<careful!>\*(C'\fR") and parameters
440 ("\f(CW\*(C`redo I<LABEL>\*(C'\fR")
441 .ie n .IP """B<text>"" \-\- bold text" 4
442 .el .IP "\f(CWB<text>\fR \-\- bold text" 4
443 .IX Xref "B B<> POD, formatting code, bold bold"
444 .IX Item "B<text> -- bold text"
445 Used for switches ("\f(CW\*(C`perl\*(Aqs B<\-n> switch\*(C'\fR"), programs
446 ("\f(CW\*(C`some systems provide a B<chfn> for that\*(C'\fR"),
447 emphasis ("\f(CW\*(C`be B<careful!>\*(C'\fR"), and so on
448 ("\f(CW\*(C`and that feature is known as B<autovivification>\*(C'\fR").
449 .ie n .IP """U<text>"" \-\- underline text" 4
450 .el .IP "\f(CWU<text>\fR \-\- underline text" 4
451 .IX Item "U<text> -- underline text"
452 This is a new addition in 2024 and may not be available in all processors or
453 output formats. Note further that some output formats cannot produce both
454 italic and underline formatting and therefore even if both are recognised,
455 they may not be visually distinct from each other.
456 .ie n .IP """C<code>"" \-\- code text" 4
457 .el .IP "\f(CWC<code>\fR \-\- code text" 4
458 .IX Xref "C C<> POD, formatting code, code code"
459 .IX Item "C<code> -- code text"
460 Renders code in a typewriter font, or gives some other indication that
461 this represents program text ("\f(CW\*(C`C<gmtime($^T)>\*(C'\fR") or some other
462 form of computerese ("\f(CW\*(C`C<drwxr\-xr\-x>\*(C'\fR").
463 .ie n .IP """L<name>"" \-\- a hyperlink" 4
464 .el .IP "\f(CWL<name>\fR \-\- a hyperlink" 4
465 .IX Xref "L L<> POD, formatting code, hyperlink hyperlink"
466 .IX Item "L<name> -- a hyperlink"
467 There are various syntaxes, listed below. In the syntaxes given,
468 \&\f(CW\*(C`text\*(C'\fR, \f(CW\*(C`name\*(C'\fR, and \f(CW\*(C`section\*(C'\fR cannot contain the characters
469 \&\*(Aq/\*(Aq and \*(Aq|\*(Aq; and any \*(Aq<\*(Aq or \*(Aq>\*(Aq should be matched.
470 .RS 4
471 .IP \(bu 4
472 \&\f(CW\*(C`L<name>\*(C'\fR
473 .Sp
474 Link to a Perl manual page (e.g., \f(CW\*(C`L<Net::Ping>\*(C'\fR). Note
475 that \f(CW\*(C`name\*(C'\fR should not contain spaces. This syntax
476 is also occasionally used for references to Unix man pages, as in
477 \&\f(CW\*(C`L<crontab(5)>\*(C'\fR.
478 .IP \(bu 4
479 \&\f(CW\*(C`L<name/"sec">\*(C'\fR or \f(CW\*(C`L<name/sec>\*(C'\fR
480 .Sp
481 Link to a section in other manual page. E.g.,
482 \&\f(CW\*(C`L<perlsyn/"For Loops">\*(C'\fR
483 .IP \(bu 4
484 \&\f(CW\*(C`L</"sec">\*(C'\fR or \f(CW\*(C`L</sec>\*(C'\fR
485 .Sp
486 Link to a section in this manual page. E.g.,
487 \&\f(CW\*(C`L</"Object Methods">\*(C'\fR
488 .RE
489 .RS 4
490 .Sp
491 A section is started by the named heading or item. For
492 example, \f(CW\*(C`L<perlvar/$.>\*(C'\fR or \f(CW\*(C`L<perlvar/"$.">\*(C'\fR both
493 link to the section started by "\f(CW\*(C`=item $.\*(C'\fR" in perlvar. And
494 \&\f(CW\*(C`L<perlsyn/For Loops>\*(C'\fR or \f(CW\*(C`L<perlsyn/"For Loops">\*(C'\fR
495 both link to the section started by "\f(CW\*(C`=head2 For Loops\*(C'\fR"
496 in perlsyn.
497 .Sp
498 To control what text is used for display, you
499 use "\f(CW\*(C`L<text|...>\*(C'\fR", as in:
500 .IP \(bu 4
501 \&\f(CW\*(C`L<text|name>\*(C'\fR
502 .Sp
503 Link this text to that manual page. E.g.,
504 \&\f(CW\*(C`L<Perl Error Messages|perldiag>\*(C'\fR
505 .IP \(bu 4
506 \&\f(CW\*(C`L<text|name/"sec">\*(C'\fR or \f(CW\*(C`L<text|name/sec>\*(C'\fR
507 .Sp
508 Link this text to that section in that manual page. E.g.,
509 \&\f(CW\*(C`L<postfix "if"|perlsyn/"Statement Modifiers">\*(C'\fR
510 .IP \(bu 4
511 \&\f(CW\*(C`L<text|/"sec">\*(C'\fR or \f(CW\*(C`L<text|/sec>\*(C'\fR
512 or \f(CW\*(C`L<text|"sec">\*(C'\fR
513 .Sp
514 Link this text to that section in this manual page. E.g.,
515 \&\f(CW\*(C`L<the various attributes|/"Member Data">\*(C'\fR
516 .RE
517 .RS 4
518 .Sp
519 Or you can link to a web page:
520 .IP \(bu 4
521 \&\f(CW\*(C`L<scheme:...>\*(C'\fR
522 .Sp
523 \&\f(CW\*(C`L<text|scheme:...>\*(C'\fR
524 .Sp
525 Links to an absolute URL. For example, \f(CW\*(C`L<http://www.perl.org/>\*(C'\fR or
526 \&\f(CW\*(C`L<The Perl Home Page|http://www.perl.org/>\*(C'\fR.
527 .RE
528 .RS 4
529 .RE
530 .ie n .IP """E<escape>"" \-\- a character escape" 4
531 .el .IP "\f(CWE<escape>\fR \-\- a character escape" 4
532 .IX Xref "E E<> POD, formatting code, escape escape"
533 .IX Item "E<escape> -- a character escape"
534 Very similar to HTML/XML \f(CW\*(C`&\fR\f(CIfoo\fR\f(CW;\*(C'\fR "entity references":
535 .RS 4
536 .IP \(bu 4
537 \&\f(CW\*(C`E<lt>\*(C'\fR \-\- a literal < (less than)
538 .IP \(bu 4
539 \&\f(CW\*(C`E<gt>\*(C'\fR \-\- a literal > (greater than)
540 .IP \(bu 4
541 \&\f(CW\*(C`E<verbar>\*(C'\fR \-\- a literal | (\fIver\fRtical \fIbar\fR)
542 .IP \(bu 4
543 \&\f(CW\*(C`E<sol>\*(C'\fR \-\- a literal / (\fIsol\fRidus)
544 .Sp
545 The above four are optional except in other formatting codes,
546 notably \f(CW\*(C`L<...>\*(C'\fR, and when preceded by a
547 capital letter.
548 .IP \(bu 4
549 \&\f(CW\*(C`E<htmlname>\*(C'\fR
550 .Sp
551 Some non\-numeric HTML entity name, such as \f(CW\*(C`E<eacute>\*(C'\fR,
552 meaning the same thing as \f(CW\*(C`&eacute;\*(C'\fR in HTML \-\- i.e., a lowercase
553 e with an acute (/\-shaped) accent.
554 .IP \(bu 4
555 \&\f(CW\*(C`E<number>\*(C'\fR
556 .Sp
557 The ASCII/Latin\-1/Unicode character with that number. A
558 leading "0x" means that \fInumber\fR is hex, as in
559 \&\f(CW\*(C`E<0x201E>\*(C'\fR. A leading "0" means that \fInumber\fR is octal,
560 as in \f(CW\*(C`E<075>\*(C'\fR. Otherwise \fInumber\fR is interpreted as being
561 in decimal, as in \f(CW\*(C`E<181>\*(C'\fR.
562 .Sp
563 Note that older Pod formatters might not recognize octal or
564 hex numeric escapes, and that many formatters cannot reliably
565 render characters above 255. (Some formatters may even have
566 to use compromised renderings of Latin\-1/CP\-1252 characters, like
567 rendering \f(CW\*(C`E<eacute>\*(C'\fR as just a plain "e".)
568 .RE
569 .RS 4
570 .RE
571 .ie n .IP """F<filename>"" \-\- used for filenames" 4
572 .el .IP "\f(CWF<filename>\fR \-\- used for filenames" 4
573 .IX Xref "F F<> POD, formatting code, filename filename"
574 .IX Item "F<filename> -- used for filenames"
575 Typically displayed in italics. Example: "\f(CW\*(C`F<.cshrc>\*(C'\fR"
576 .ie n .IP """S<text>"" \-\- text contains non\-breaking spaces" 4
577 .el .IP "\f(CWS<text>\fR \-\- text contains non\-breaking spaces" 4
578 .IX Xref "S S<> POD, formatting code, non-breaking space non-breaking space"
579 .IX Item "S<text> -- text contains non-breaking spaces"
580 This means that the words in \fItext\fR should not be broken
581 across lines. Example: \f(CW\*(C`S<$x\ ?\ $y\ :\ $z>\*(C'\fR.
582 .ie n .IP """X<topic name>"" \-\- an index entry" 4
583 .el .IP "\f(CWX<topic name>\fR \-\- an index entry" 4
584 .IX Xref "X X<> POD, formatting code, index entry index entry"
585 .IX Item "X<topic name> -- an index entry"
586 This is ignored by most formatters, but some may use it for building
587 indexes. It always renders as empty\-string.
588 Example: \f(CW\*(C`X<absolutizing relative URLs>\*(C'\fR
589 .ie n .IP """Z<>"" \-\- a null (zero\-effect) formatting code" 4
590 .el .IP "\f(CWZ<>\fR \-\- a null (zero\-effect) formatting code" 4
591 .IX Xref "Z Z<> POD, formatting code, null null"
592 .IX Item "Z<> -- a null (zero-effect) formatting code"
593 This is rarely used. It\*(Aqs one way to get around using an
594 E<...> code sometimes. For example, instead of
595 "\f(CW\*(C`NE<lt>3\*(C'\fR" (for "N<3") you could write
596 "\f(CW\*(C`NZ<><3\*(C'\fR" (the "Z<>" breaks up the "N" and
597 the "<" so they can\*(Aqt be considered
598 the part of a (fictitious) "N<...>" code).
599 .Sp
600 Another use is to indicate that \fIstuff\fR in \f(CW\*(C`=item Z<>\fR\f(CIstuff...\fR\f(CW\*(C'\fR
601 is not to be considered to be a bullet or number. For example,
602 without the \f(CW\*(C`Z<>\*(C'\fR, the line
603 .Sp
604 .Vb 1
605 \& =item Z<>500 Server error
606 .Ve
607 .Sp
608 could possibly be parsed as an item in a numbered list when it isn\*(Aqt
609 meant to be.
610 .Sp
611 Still another use is to maintain visual space between \f(CW\*(C`=item\*(C'\fR lines.
612 If you specify
613 .Sp
614 .Vb 1
615 \& =item foo
616 \&
617 \& =item bar
618 .Ve
619 .Sp
620 it will typically get rendered as
621 .Sp
622 .Vb 2
623 \& foo
624 \& bar
625 .Ve
626 .Sp
627 That may be what you want, but if what you really want is
628 .Sp
629 .Vb 1
630 \& foo
631 \&
632 \& bar
633 .Ve
634 .Sp
635 you can use \f(CW\*(C`Z<>\*(C'\fR to accomplish that
636 .Sp
637 .Vb 1
638 \& =item foo
639 \&
640 \& Z<>
641 \&
642 \& =item bar
643 .Ve
644 .PP
645 Most of the time, you will need only a single set of angle brackets to
646 delimit the beginning and end of formatting codes. However,
647 sometimes you will want to put a real right angle bracket (a
648 greater\-than sign, \*(Aq>\*(Aq) inside of a formatting code. This is particularly
649 common when using a formatting code to provide a different font\-type for a
650 snippet of code. As with all things in Perl, there is more than
651 one way to do it. One way is to simply escape the closing bracket
652 using an \f(CW\*(C`E\*(C'\fR code:
653 .PP
654 .Vb 1
655 \& C<$a E<lt>=E<gt> $b>
656 .Ve
657 .PP
658 This will produce: "\f(CW\*(C`$a <=> $b\*(C'\fR"
659 .PP
660 A more readable, and perhaps more "plain" way is to use an alternate
661 set of delimiters that doesn\*(Aqt require a single ">" to be escaped.
662 Doubled angle brackets ("<<" and ">>") may be used \fIif and only if there is
663 whitespace right after the opening delimiter and whitespace right
664 before the closing delimiter!\fR For example, the following will
665 do the trick:
666 .IX Xref "POD, formatting code, escaping with multiple brackets"
667 .PP
668 .Vb 1
669 \& C<< $a <=> $b >>
670 .Ve
671 .PP
672 In fact, you can use as many repeated angle\-brackets as you like so
673 long as you have the same number of them in the opening and closing
674 delimiters, and make sure that whitespace immediately follows the last
675 \&\*(Aq<\*(Aq of the opening delimiter, and immediately precedes the first \*(Aq>\*(Aq
676 of the closing delimiter. (The whitespace is ignored.) So the
677 following will also work:
678 .IX Xref "POD, formatting code, escaping with multiple brackets"
679 .PP
680 .Vb 2
681 \& C<<< $a <=> $b >>>
682 \& C<<<< $a <=> $b >>>>
683 .Ve
684 .PP
685 And they all mean exactly the same as this:
686 .PP
687 .Vb 1
688 \& C<$a E<lt>=E<gt> $b>
689 .Ve
690 .PP
691 The multiple\-bracket form does not affect the interpretation of the contents of
692 the formatting code, only how it must end. That means that the examples above
693 are also exactly the same as this:
694 .PP
695 .Vb 1
696 \& C<< $a E<lt>=E<gt> $b >>
697 .Ve
698 .PP
699 As a further example, this means that if you wanted to put these bits of
700 code in \f(CW\*(C`C\*(C'\fR (code) style:
701 .PP
702 .Vb 2
703 \& open(X, ">>thing.dat") || die $!
704 \& $foo\->bar();
705 .Ve
706 .PP
707 you could do it like so:
708 .PP
709 .Vb 2
710 \& C<<< open(X, ">>thing.dat") || die $! >>>
711 \& C<< $foo\->bar(); >>
712 .Ve
713 .PP
714 which is presumably easier to read than the old way:
715 .PP
716 .Vb 2
717 \& C<open(X, "E<gt>E<gt>thing.dat") || die $!>
718 \& C<$foo\-E<gt>bar();>
719 .Ve
720 .PP
721 This is currently supported by pod2text (Pod::Text), pod2man (Pod::Man),
722 and any other pod2xxx or Pod::Xxxx translators that use
723 Pod::Parser 1.093 or later, or Pod::Tree 1.02 or later.
724 .SS "The Intent"
725 .IX Xref "POD, intent of"
726 .IX Subsection "The Intent"
727 The intent is simplicity of use, not power of expression. Paragraphs
728 look like paragraphs (block format), so that they stand out
729 visually, and so that I could run them through \f(CW\*(C`fmt\*(C'\fR easily to reformat
730 them (that\*(Aqs F7 in my version of \fBvi\fR, or Esc Q in my version of
731 \&\fBemacs\fR). I wanted the translator to always leave the \f(CW\*(C`\*(Aq\*(C'\fR and \f(CW\*(C`\`\*(C'\fR and
732 \&\f(CW\*(C`"\*(C'\fR quotes alone, in verbatim mode, so I could slurp in a
733 working program, shift it over four spaces, and have it print out, er,
734 verbatim. And presumably in a monospace font.
735 .PP
736 The Pod format is not necessarily sufficient for writing a book. Pod
737 is just meant to be an idiot\-proof common source for nroff, HTML,
738 TeX, and other markup languages, as used for online
739 documentation. Translators exist for \fBpod2text\fR, \fBpod2html\fR,
740 \&\fBpod2man\fR (that\*(Aqs for \fBnroff\fR\|(1) and \fBtroff\fR\|(1)), \fBpod2latex\fR, and
741 \&\fBpod2fm\fR. Various others are available in CPAN.
742 .SS "Embedding Pods in Perl Modules"
743 .IX Xref "POD, embedding"
744 .IX Subsection "Embedding Pods in Perl Modules"
745 You can embed Pod documentation in your Perl modules and scripts. Start
746 your documentation with an empty line, a "=head1" command at the
747 beginning, and end it with a "=cut" command and an empty line. The
748 \&\fBperl\fR executable will ignore the Pod text. You can place a Pod
749 statement where \fBperl\fR expects the beginning of a new statement, but
750 not within a statement, as that would result in an error. See any of
751 the supplied library modules for examples.
752 .PP
753 If you\*(Aqre going to put your Pod at the end of the file, and you\*(Aqre using
754 an \f(CW\*(C`_\|_END_\|_\*(C'\fR or \f(CW\*(C`_\|_DATA_\|_\*(C'\fR cut mark, make sure to put an empty line there
755 before the first Pod command.
756 .PP
757 .Vb 1
758 \& _\|_END_\|_
759 \&
760 \& =head1 NAME
761 \&
762 \& Time::Local \- efficiently compute time from local and GMT time
763 .Ve
764 .PP
765 Without that empty line before the "=head1", many translators wouldn\*(Aqt
766 have recognized the "=head1" as starting a Pod block.
767 .SS "Hints for Writing Pod"
768 .IX Subsection "Hints for Writing Pod"
769 .IP \(bu 4
770
771 .IX Xref "podchecker POD, validating"
772 .Sp
773 The \fBpodchecker\fR command is provided for checking Pod syntax for errors
774 and warnings. For example, it checks for completely blank lines in
775 Pod blocks and for unknown commands and formatting codes. You should
776 still also pass your document through one or more translators and proofread
777 the result, or print out the result and proofread that. Some of the
778 problems found may be bugs in the translators, which you may or may not
779 wish to work around.
780 .IP \(bu 4
781 If you\*(Aqre more familiar with writing in HTML than with writing in Pod, you
782 can try your hand at writing documentation in simple HTML, and converting
783 it to Pod with the experimental Pod::HTML2Pod module,
784 (available in CPAN), and looking at the resulting code. The experimental
785 Pod::PXML module in CPAN might also be useful.
786 .IP \(bu 4
787 Many older Pod translators require the lines before every Pod
788 command and after every Pod command (including "=cut"!) to be a blank
789 line. Having something like this:
790 .Sp
791 .Vb 2
792 \& # \- \- \- \- \- \- \- \- \- \- \- \-
793 \& =item $firecracker\->boom()
794 \&
795 \& This noisily detonates the firecracker object.
796 \& =cut
797 \& sub boom {
798 \& ...
799 .Ve
800 .Sp
801 \&...will make such Pod translators completely fail to see the Pod block
802 at all.
803 .Sp
804 Instead, have it like this:
805 .Sp
806 .Vb 1
807 \& # \- \- \- \- \- \- \- \- \- \- \- \-
808 \&
809 \& =item $firecracker\->boom()
810 \&
811 \& This noisily detonates the firecracker object.
812 \&
813 \& =cut
814 \&
815 \& sub boom {
816 \& ...
817 .Ve
818 .IP \(bu 4
819 Some older Pod translators require paragraphs (including command
820 paragraphs like "=head2 Functions") to be separated by \fIcompletely\fR
821 empty lines. If you have an apparently empty line with some spaces
822 on it, this might not count as a separator for those translators, and
823 that could cause odd formatting.
824 .IP \(bu 4
825 Older translators might add wording around an L<> link, so that
826 \&\f(CW\*(C`L<Foo::Bar>\*(C'\fR may become "the Foo::Bar manpage", for example.
827 So you shouldn\*(Aqt write things like \f(CW\*(C`the L<foo>
828 documentation\*(C'\fR, if you want the translated document to read sensibly.
829 Instead, write \f(CW\*(C`the L<Foo::Bar|Foo::Bar> documentation\*(C'\fR or
830 \&\f(CW\*(C`L<the Foo::Bar documentation|Foo::Bar>\*(C'\fR, to control how the
831 link comes out.
832 .IP \(bu 4
833 Going past the 70th column in a verbatim block might be ungracefully
834 wrapped by some formatters.
835 .SH "SEE ALSO"
836 .IX Header "SEE ALSO"
837 perlpodspec, "PODs: Embedded Documentation" in perlsyn,
838 perlnewmod, perldoc, pod2html, pod2man, podchecker.
839 .SH AUTHOR
840 .IX Header "AUTHOR"
841 Larry Wall, Sean M. Burke