~ubuntu-branches/ubuntu/intrepid/perl-doc-html/intrepid

« back to all changes in this revision

Viewing changes to perlpod.html

  • Committer: Bazaar Package Importer
  • Author(s): Roberto C. Sanchez
  • Date: 2008-05-17 20:14:19 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080517201419-qgbuogq2ckkdisyi
Tags: 5.10.0-2
Supersede botched upload of 5.10.0-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
      <h2>Links:</h2>
55
55
      <ul>
56
56
        <li><a href="http://search.cpan.org">CPAN</a></li>
 
57
        <li><a href="http://www.perl.org">Perl.org</a></li>
57
58
        <li><a href="http://www.perl.com">Perl.com</a></li>
58
 
        <li><a href="http://www.perl.org">Perl.org</a></li>
 
59
        <li><a href="http://perlbuzz.com">Perl Buzz</a></li>
 
60
        <li><a href="http://www.perlfoundation.org/perl5/index.cgi">Perl 5 Wiki</a></li>
 
61
        <li><a href="http://jobs.perl.org">Perl Jobs</a></li>
59
62
        <li><a href="http://www.pm.org">Perl Mongers</a></li>
60
63
        <li><a href="http://www.perlmonks.org">Perl Monks</a></li>
61
64
        <li><a href="http://planet.perl.org">Planet Perl</a></li>
65
68
      <ul>
66
69
        <li>Site maintained by<br><a href="http://perl.jonallen.info">Jon Allen</a>
67
70
            (<a href="http://perl.jonallen.info">JJ</a>)</li>
68
 
        <li class="spaced">Last updated on<br>23 April 2006</li>
 
71
        <li class="spaced">Last updated on<br>23 December 2007</li>
69
72
        <li class="spaced">See the <a href="http://perl.jonallen.info/projects/perldoc">project page</a> for
70
73
        more details</li>
71
74
      </ul>
76
79
    <div id="centerContent">
77
80
      <div id="contentHeader">
78
81
        <div id="contentHeaderLeft"><a href="#" onClick="showLeft()">Show navigation</a></div>
79
 
        <div id="contentHeaderCentre">-- Perl 5.8.8 documentation --</div>
 
82
        <div id="contentHeaderCentre">-- Perl 5.10.0 documentation --</div>
80
83
        <div id="contentHeaderRight"><a href="#" onClick="showRight()">Show toolbar</a></div>
81
84
      </div>
82
85
      <div id="breadCrumbs"><a href="index.html">Home</a> &gt; <a href="index-language.html">Language reference</a> &gt; perlpod</div>
83
86
      <script language="JavaScript">fromSearch();</script>
84
 
      <div id="contentBody"><div class="title_container"><div class="page_title">perlpod</div></div><ul><li><a href="#NAME-POD-plain-old-documentation">NAME
85
 
 </a><li><a href="#DESCRIPTION">DESCRIPTION</a><ul><li><a href="#Ordinary-Paragraph-POD%2c-ordinary-paragraph">Ordinary Paragraph
86
 
</a><li><a href="#Verbatim-Paragraph-POD%2c-verbatim-paragraph-verbatim">Verbatim Paragraph
87
 
 </a><li><a href="#Command-Paragraph-POD%2c-command">Command Paragraph
88
 
</a><li><a href="#Formatting-Codes-POD%2c-formatting-code-formatting-code-POD%2c-interior-sequence-interior-sequence">Formatting Codes
 
87
      <div id="contentBody"><div class="title_container"><div class="page_title">perlpod</div></div><ul><li><a href="#NAME">NAME
 
88
 </a><li><a href="#DESCRIPTION">DESCRIPTION</a><ul><li><a href="#Ordinary-Paragraph">Ordinary Paragraph
 
89
</a><li><a href="#Verbatim-Paragraph">Verbatim Paragraph
 
90
 </a><li><a href="#Command-Paragraph">Command Paragraph
 
91
</a><li><a href="#Formatting-Codes">Formatting Codes
89
92
 
90
 
 </a><li><a href="#The-Intent-POD%2c-intent-of">The Intent
91
 
</a><li><a href="#Embedding-Pods-in-Perl-Modules-POD%2c-embedding">Embedding Pods in Perl Modules
92
 
</a><li><a href="#Hints-for-Writing-Pod">Hints for Writing Pod</a></ul><li><a href="#SEE-ALSO">SEE ALSO</a><li><a href="#AUTHOR">AUTHOR</a></ul><a name="NAME-POD-plain-old-documentation"></a><h1>NAME
 
93
 </a><li><a href="#The-Intent">The Intent
 
94
</a><li><a href="#Embedding-Pods-in-Perl-Modules">Embedding Pods in Perl Modules
 
95
</a><li><a href="#Hints-for-Writing-Pod">Hints for Writing Pod</a></ul><li><a href="#SEE-ALSO">SEE ALSO</a><li><a href="#AUTHOR">AUTHOR</a></ul><a name="NAME"></a><h1>NAME
93
96
 </h1>
94
97
<p>perlpod - the Plain Old Documentation format</p>
95
98
<a name="DESCRIPTION"></a><h1>DESCRIPTION</h1>
101
104
<a href="#Ordinary-Paragraph">ordinary</a>,
102
105
<a href="#Verbatim-Paragraph">verbatim</a>, and 
103
106
<a href="#Command-Paragraph">command</a>.</p>
104
 
<a name="Ordinary-Paragraph-POD%2c-ordinary-paragraph"></a><h2>Ordinary Paragraph
 
107
<a name="Ordinary-Paragraph"></a><h2>Ordinary Paragraph
105
108
</h2>
106
109
<p>Most paragraphs in your documentation will be ordinary blocks
107
110
of text, like this one.  You can simply type in your text without
110
113
like being rewrapped, probably put into a proportionally spaced
111
114
font, and maybe even justified.</p>
112
115
<p>You can use formatting codes in ordinary paragraphs, for <b>bold</b>,
113
 
<i>italic</i>, <code class="inline">code-style</code>
 
116
<i>italic</i>, <code class="inline"><span class="w">code</span>-<span class="w">style</span></code>
114
117
, <a href="perlfaq.html">hyperlinks</a>, and more.  Such
115
118
codes are explained in the "<a href="#Formatting-Codes">Formatting Codes</a>"
116
119
section, below.</p>
117
 
<a name="Verbatim-Paragraph-POD%2c-verbatim-paragraph-verbatim"></a><h2>Verbatim Paragraph
 
120
<a name="Verbatim-Paragraph"></a><h2>Verbatim Paragraph
118
121
 </h2>
119
122
<p>Verbatim paragraphs are usually used for presenting a codeblock or
120
123
other text which does not require any special parsing or formatting,
125
128
be on 8-column boundaries.  There are no special formatting codes,
126
129
so you can't italicize or anything like that.  A \ means \, and
127
130
nothing else.</p>
128
 
<a name="Command-Paragraph-POD%2c-command"></a><h2>Command Paragraph
 
131
<a name="Command-Paragraph"></a><h2>Command Paragraph
129
132
</h2>
130
133
<p>A command paragraph is used for special treatment of whole chunks
131
134
of text, usually as headings or parts of lists.</p>
147
150
    =encoding type
148
151
    =cut</pre><p>To explain them each in detail:</p>
149
152
<ul>
150
 
<li><a name="'%3dhead1-_Heading-Text_'-%3dhead1-%3dhead2-%3dhead3-%3dhead4-head1-head2-head3-head4"></a><b><code class="inline"><span class="pd">=head1 Heading Text</span></code>
 
153
<li><a name="'%3dhead1-_Heading-Text_'"></a><b><code class="inline"><span class="pd">=head1 &lt;i&gt;Heading Text&lt;/i&gt;</span></code>
151
154
 
152
155
   
153
156
   </b>
154
157
</li>
155
 
<li><a name="'%3dhead2-_Heading-Text_'"></a><b><code class="inline"><span class="pd">=head2 Heading Text</span></code>
156
 
</b>
157
 
</li>
158
 
<li><a name="'%3dhead3-_Heading-Text_'"></a><b><code class="inline"><span class="pd">=head3 Heading Text</span></code>
159
 
</b>
160
 
</li>
161
 
<li><a name="'%3dhead4-_Heading-Text_'"></a><b><code class="inline"><span class="pd">=head4 Heading Text</span></code>
 
158
<li><a name="'%3dhead2-_Heading-Text_'"></a><b><code class="inline"><span class="pd">=head2 &lt;i&gt;Heading Text&lt;/i&gt;</span></code>
 
159
</b>
 
160
</li>
 
161
<li><a name="'%3dhead3-_Heading-Text_'"></a><b><code class="inline"><span class="pd">=head3 &lt;i&gt;Heading Text&lt;/i&gt;</span></code>
 
162
</b>
 
163
</li>
 
164
<li><a name="'%3dhead4-_Heading-Text_'"></a><b><code class="inline"><span class="pd">=head4 &lt;i&gt;Heading Text&lt;/i&gt;</span></code>
162
165
</b>
163
166
<p>Head1 through head4 produce headings, head1 being the highest
164
167
level.  The text in the rest of this paragraph is the content of the
165
168
heading.  For example:</p>
166
 
<pre class="verbatim">  =head2 Object Attributes</pre>
 
169
<pre class="verbatim">  =<span class="w">head2</span> <span class="w">Object</span> <span class="w">Attributes</span></pre>
167
170
<p>The text "Object Attributes" comprises the heading there.  (Note that
168
171
head3 and head4 are recent additions, not supported in older Pod
169
172
translators.)  The text in these heading commands can use
170
173
formatting codes, as seen here:</p>
171
 
<pre class="verbatim">  =head2 Possible Values for C<span class="q">&lt;$/&gt;</span></pre>
 
174
<pre class="verbatim">  =<span class="w">head2</span> <span class="w">Possible</span> <span class="w">Values</span> for <span class="w">C</span><span class="q">&lt;$/&gt;</span></pre>
172
175
<p>Such commands are explained in the
173
176
"<a href="#Formatting-Codes">Formatting Codes</a>" section, below.</p>
174
177
</li>
175
 
<li><a name="'%3dover-_indentlevel_'-%3dover-%3ditem-%3dback-over-item-back"></a><b><code class="inline"><span class="pd">=over indentlevel</span></code>
 
178
<li><a name="'%3dover-_indentlevel_'"></a><b><code class="inline"><span class="pd">=over &lt;i&gt;indentlevel&lt;/i&gt;</span></code>
176
179
 
177
180
     </b>
178
181
</li>
179
 
<li><a name="'%3ditem-_stuff..._'"></a><b><code class="inline"><span class="pd">=item stuff...</span></code>
 
182
<li><a name="'%3ditem-_stuff..._'"></a><b><code class="inline"><span class="pd">=item &lt;i&gt;stuff...&lt;/i&gt;</span></code>
180
183
</b>
181
184
</li>
182
185
<li><a name="'%3dback'"></a><b><code class="inline"><span class="pd">=back</span></code>
189
192
one em is the width of an "M" in the document's base font) or roughly
190
193
comparable units; if there is no <i>indentlevel</i> option, it defaults
191
194
to four.  (And some formatters may just ignore whatever <i>indentlevel</i>
192
 
you provide.)  In the <i>stuff</i> in <code class="inline"><span class="pd">=item stuff...</span></code>
 
195
you provide.)  In the <i>stuff</i> in <code class="inline"><span class="pd">=item &lt;i&gt;stuff...&lt;/i&gt;</span></code>
193
196
, you may
194
197
use formatting codes, as seen here:</p>
195
 
<pre class="verbatim">  =item Using C&lt;<span class="i">$|</span>&gt; to Control Buffering</pre>
 
198
<pre class="verbatim">  =<span class="w">item</span> <span class="w">Using</span> <span class="w">C</span>&lt;<span class="i">$|</span>&gt; <span class="w">to</span> <span class="w">Control</span> <span class="w">Buffering</span></pre>
196
199
<p>Such commands are explained in the
197
200
"<a href="#Formatting-Codes">Formatting Codes</a>" section, below.</p>
198
201
<p>Note also that there are some basic rules to using "=over" ...
221
224
</li>
222
225
</ul>
223
226
</li>
224
 
<li><a name="'%3dcut'-%3dcut-cut"></a><b><code class="inline"><span class="pd">=cut</span></code>
 
227
<li><a name="'%3dcut'"></a><b><code class="inline"><span class="pd">=cut</span></code>
225
228
 
226
229
 </b>
227
230
<p>To end a Pod block, use a blank line,
230
233
this is where Perl code is resuming.  (The blank line before the "=cut"
231
234
is not technically necessary, but many older Pod processors require it.)</p>
232
235
</li>
233
 
<li><a name="'%3dpod'-%3dpod-pod"></a><b><code class="inline"><span class="pd">=pod</span></code>
 
236
<li><a name="'%3dpod'"></a><b><code class="inline"><span class="pd">=pod</span></code>
234
237
 
235
238
 </b>
236
239
<p>The "=pod" command by itself doesn't do much of anything, but it
238
241
Pod block starts with <i>any</i> command paragraph, so a "=pod" command is
239
242
usually used just when you want to start a Pod block with an ordinary
240
243
paragraph or a verbatim paragraph.  For example:</p>
241
 
<pre class="verbatim">  =item <span class="i">stuff</span><span class="s">(</span><span class="s">)</span></pre>
242
 
<pre class="verbatim">  This function does stuff.</pre>
243
 
<pre class="verbatim">  =cut</pre>
 
244
<pre class="verbatim">  =<span class="w">item</span> <span class="i">stuff</span><span class="s">(</span><span class="s">)</span></pre>
 
245
<pre class="verbatim">  <span class="w">This</span> <span class="w">function</span> <span class="w">does</span> <span class="w">stuff</span>.</pre>
 
246
<pre class="verbatim">  =<span class="w">cut</span></pre>
244
247
<pre class="verbatim"><a name="stuff"></a>  sub <span class="m">stuff</span> <span class="s">{</span>
245
248
    ...
246
249
  <span class="s">}</span></pre>
247
 
<pre class="verbatim">  =pod</pre>
 
250
<pre class="verbatim">  =<span class="w">pod</span></pre>
248
251
<pre class="verbatim">  Remember to check its return value, as in:</pre><pre class="verbatim">    <span class="i">stuff</span><span class="s">(</span><span class="s">)</span> || <a class="l_k" href="functions/die.html">die</a> <span class="q">&quot;Couldn&#39;t do stuff!&quot;</span><span class="sc">;</span></pre>
249
 
<pre class="verbatim">  =cut</pre>
 
252
<pre class="verbatim">  =<span class="w">cut</span></pre>
250
253
</li>
251
 
<li><a name="'%3dbegin-_formatname_'-%3dbegin-%3dend-%3dfor-begin-end-for"></a><b><code class="inline"><span class="pd">=begin formatname</span></code>
 
254
<li><a name="'%3dbegin-_formatname_'"></a><b><code class="inline"><span class="pd">=begin &lt;i&gt;formatname&lt;/i&gt;</span></code>
252
255
 
253
256
     </b>
254
257
</li>
255
 
<li><a name="'%3dend-_formatname_'"></a><b><code class="inline"><span class="pd">=end formatname</span></code>
 
258
<li><a name="'%3dend-_formatname_'"></a><b><code class="inline"><span class="pd">=end &lt;i&gt;formatname&lt;/i&gt;</span></code>
256
259
</b>
257
260
</li>
258
 
<li><a name="'%3dfor-_formatname_-_text..._'"></a><b><code class="inline"><span class="pd">=for formatname text...</span></code>
 
261
<li><a name="'%3dfor-_formatname_-_text..._'"></a><b><code class="inline"><span class="pd">=for &lt;i&gt;formatname&lt;/i&gt; &lt;i&gt;text...&lt;/i&gt;</span></code>
259
262
</b>
260
263
<p>For, begin, and end will let you have regions of text/code/data that
261
264
are not generally interpreted as normal Pod text, but are passed
263
266
formatter that can use that format will use the region, otherwise it
264
267
will be completely ignored.</p>
265
268
<p>A command "=begin <i>formatname</i>", some paragraphs, and a
266
 
command "=end <i>formatname</i>", mean that the text/data inbetween
 
269
command "=end <i>formatname</i>", mean that the text/data in between
267
270
is meant for formatters that understand the special format
268
271
called <i>formatname</i>.  For example,</p>
269
 
<pre class="verbatim">  =begin html</pre>
 
272
<pre class="verbatim">  =<span class="w">begin</span> <span class="w">html</span></pre>
270
273
<pre class="verbatim">  &lt;hr&gt; &lt;img src="thang.png"&gt;
271
 
  &lt;p&gt; This is a raw HTML paragraph &lt;/p&gt;</pre><pre class="verbatim">  =end html</pre>
 
274
  &lt;p&gt; This is a raw HTML paragraph &lt;/p&gt;</pre><pre class="verbatim">  =<span class="w">end</span> <span class="w">html</span></pre>
272
275
<p>The command "=for <i>formatname</i> <i>text...</i>"
273
276
specifies that the remainder of just this paragraph (starting
274
 
right after <i>formatname</i>) is in that special format.  </p>
 
277
right after <i>formatname</i>) is in that special format.</p>
275
278
<pre class="verbatim">  =for html &lt;hr&gt; &lt;img src="thang.png"&gt;
276
279
  &lt;p&gt; This is a raw HTML paragraph &lt;/p&gt;</pre><p>This means the same thing as the above "=begin html" ... "=end html"
277
280
region.</p>
282
285
after the "=begin" command and a blank line before the "=end"
283
286
command.</p>
284
287
<p>Here are some examples of how to use these:</p>
285
 
<pre class="verbatim">  =begin html</pre>
286
 
<pre class="verbatim">  &lt;br&gt;Figure 1.&lt;br&gt;&lt;IMG SRC="figure1.png"&gt;&lt;br&gt;</pre><pre class="verbatim">  =end html</pre>
287
 
<pre class="verbatim">  =begin text</pre>
 
288
<pre class="verbatim">  =<span class="w">begin</span> <span class="w">html</span></pre>
 
289
<pre class="verbatim">  &lt;br&gt;Figure 1.&lt;br&gt;&lt;IMG SRC="figure1.png"&gt;&lt;br&gt;</pre><pre class="verbatim">  =<span class="w">end</span> <span class="w">html</span></pre>
 
290
<pre class="verbatim">  =<span class="w">begin</span> <span class="w">text</span></pre>
288
291
<pre class="verbatim">    ---------------
289
292
    |  foo        |
290
293
    |        bar  |
291
 
    ---------------</pre><pre class="verbatim">  ^^^^ Figure 1. ^^^^</pre><pre class="verbatim">  =end text</pre>
 
294
    ---------------</pre><pre class="verbatim">  ^^^^ Figure 1. ^^^^</pre><pre class="verbatim">  =<span class="w">end</span> <span class="w">text</span></pre>
292
295
<p>Some format names that formatters currently are known to accept
293
296
include "roff", "man", "latex", "tex", "text", and "html".  (Some
294
297
formatters will treat some of these as synonyms.)</p>
295
298
<p>A format name of "comment" is common for just making notes (presumably
296
299
to yourself) that won't appear in any formatted version of the Pod
297
300
document:</p>
298
 
<pre class="verbatim">  =for comment
299
 
  Make sure that all the available options are documented!</pre>
 
301
<pre class="verbatim">  =for <span class="w">comment</span>
 
302
  <span class="w">Make</span> <span class="w">sure</span> <span class="w">that</span> <span class="w">all</span> <span class="w">the</span> <span class="w">available</span> <span class="w">options</span> <span class="w">are</span> <span class="w">documented</span>!</pre>
300
303
<p>Some <i>formatnames</i> will require a leading colon (as in
301
304
<code class="inline"><span class="q">&quot;=for :formatname&quot;</span></code>
302
305
, or
307
310
normal formatting (e.g., may not be a normal-use paragraph, but might
308
311
be for formatting as a footnote).</p>
309
312
</li>
310
 
<li><a name="'%3dencoding-_encodingname_'-%3dencoding-encoding"></a><b><code class="inline"><span class="pd">=encoding encodingname</span></code>
 
313
<li><a name="'%3dencoding-_encodingname_'"></a><b><code class="inline"><span class="pd">=encoding &lt;i&gt;encodingname&lt;/i&gt;</span></code>
311
314
 
312
315
 </b>
313
316
<p>This command is used for declaring the encoding of a document.  Most
314
317
users won't need this; but if your encoding isn't US-ASCII or Latin-1,
315
 
then put a <code class="inline"><span class="pd">=encoding encodingname</span></code>
 
318
then put a <code class="inline"><span class="pd">=encoding &lt;i&gt;encodingname&lt;/i&gt;</span></code>
316
319
 command early in the document so
317
320
that pod formatters will know how to decode the document.  For
318
321
<i>encodingname</i>, use a name recognized by the <a href="Encode/Supported.html">Encode::Supported</a>
319
322
module.  Examples:</p>
320
 
<pre class="verbatim">  =<a class="l_w" href="encoding.html">encoding</a> <a class="l_w" href="utf8.html">utf8</a></pre>
321
 
<pre class="verbatim">  =<a class="l_w" href="encoding.html">encoding</a> koi8-r
322
 
  
323
 
  =<a class="l_w" href="encoding.html">encoding</a> ShiftJIS
324
 
  
325
 
  =<a class="l_w" href="encoding.html">encoding</a> big5</pre>
 
323
<pre class="verbatim">  =<span class="w">encoding</span> <span class="w">utf8</span></pre>
 
324
<pre class="verbatim">  =<span class="w">encoding</span> <span class="w">koi8</span>-r</pre>
 
325
<pre class="verbatim">  =<span class="w">encoding</span> <span class="w">ShiftJIS</span></pre>
 
326
<pre class="verbatim">  =<span class="w">encoding</span> <span class="w">big5</span></pre>
326
327
</li>
327
328
</ul>
328
329
<p>And don't forget, when using any command, that the command lasts up
330
331
examples below, you can see that every command needs the blank
331
332
line after it, to end its paragraph.</p>
332
333
<p>Some examples of lists include:</p>
333
 
<pre class="verbatim">  =over</pre>
334
 
<pre class="verbatim">  =item *</pre>
335
 
<pre class="verbatim">  First item</pre>
336
 
<pre class="verbatim">  =item *</pre>
337
 
<pre class="verbatim">  Second item</pre>
338
 
<pre class="verbatim">  =back</pre>
339
 
<pre class="verbatim">  =over</pre>
340
 
<pre class="verbatim">  =item <span class="i">Foo</span><span class="s">(</span><span class="s">)</span></pre>
341
 
<pre class="verbatim">  Description of Foo function</pre>
342
 
<pre class="verbatim">  =item <span class="i">Bar</span><span class="s">(</span><span class="s">)</span></pre>
343
 
<pre class="verbatim">  Description of Bar function</pre>
344
 
<pre class="verbatim">  =back</pre>
345
 
<a name="Formatting-Codes-POD%2c-formatting-code-formatting-code-POD%2c-interior-sequence-interior-sequence"></a><h2>Formatting Codes
 
334
<pre class="verbatim">  =<span class="w">over</span></pre>
 
335
<pre class="verbatim">  =<span class="w">item</span> *</pre>
 
336
<pre class="verbatim">  <span class="w">First</span> <span class="w">item</span></pre>
 
337
<pre class="verbatim">  =<span class="w">item</span> *</pre>
 
338
<pre class="verbatim">  <span class="w">Second</span> <span class="w">item</span></pre>
 
339
<pre class="verbatim">  =<span class="w">back</span></pre>
 
340
<pre class="verbatim">  =<span class="w">over</span></pre>
 
341
<pre class="verbatim">  =<span class="w">item</span> <span class="i">Foo</span><span class="s">(</span><span class="s">)</span></pre>
 
342
<pre class="verbatim">  <span class="w">Description</span> <span class="w">of</span> <span class="w">Foo</span> <span class="w">function</span></pre>
 
343
<pre class="verbatim">  =<span class="w">item</span> <span class="i">Bar</span><span class="s">(</span><span class="s">)</span></pre>
 
344
<pre class="verbatim">  <span class="w">Description</span> <span class="w">of</span> <span class="w">Bar</span> <span class="w">function</span></pre>
 
345
<pre class="verbatim">  =<span class="w">back</span></pre>
 
346
<a name="Formatting-Codes"></a><h2>Formatting Codes
346
347
 
347
348
 </h2>
348
349
<p>In ordinary paragraphs and in some command paragraphs, various
349
350
formatting codes (a.k.a. "interior sequences") can be used:</p>
350
351
<ul>
351
 
<li><a name="'I%3ctext%3e'----italic-text-I-I%3c%3e-POD%2c-formatting-code%2c-italic-italic"></a><b><code class="inline">I<span class="q">&lt;text&gt;</span></code>
 
352
<li><a name="'I%3ctext%3e'----italic-text"></a><b><code class="inline"><span class="w">I</span><span class="q">&lt;text&gt;</span></code>
352
353
 -- italic text
353
354
   </b>
354
 
<p>Used for emphasis ("<code class="inline">be I<span class="q">&lt;careful!&gt;</span></code>
 
355
<p>Used for emphasis ("<code class="inline"><span class="w">be</span> <span class="w">I</span><span class="q">&lt;careful!&gt;</span></code>
355
356
") and parameters
356
357
("<code class="inline"><a class="l_k" href="functions/redo.html">redo</a> <span class="j">I</span><span class="q">&lt;LABEL&gt;</span></code>
357
358
")</p>
358
359
</li>
359
 
<li><a name="'B%3ctext%3e'----bold-text-B-B%3c%3e-POD%2c-formatting-code%2c-bold-bold"></a><b><code class="inline"><a class="l_w" href="B.html">B</a><span class="q">&lt;text&gt;</span></code>
 
360
<li><a name="'B%3ctext%3e'----bold-text"></a><b><code class="inline"><span class="w">B</span><span class="q">&lt;text&gt;</span></code>
360
361
 -- bold text
361
362
   </b>
362
 
<p>Used for switches ("<code class="inline">perl&#39;s <a class="l_w" href="B.html">B</a><span class="q">&lt;-n&gt;</span> switch</code>
 
363
<p>Used for switches ("<code class="inline"><span class="w">perl&#39;s</span> <span class="w">B</span><span class="q">&lt;-n&gt;</span> switch</code>
363
364
"), programs
364
 
("<code class="inline">some systems provide a <a class="l_w" href="B.html">B</a><span class="q">&lt;chfn&gt;</span> for that</code>
 
365
("<code class="inline"><span class="w">some</span> <span class="w">systems</span> <span class="w">provide</span> <span class="w">a</span> <span class="w">B</span><span class="q">&lt;chfn&gt;</span> for <span class="w">that</span></code>
365
366
"),
366
 
emphasis ("<code class="inline">be <a class="l_w" href="B.html">B</a><span class="q">&lt;careful!&gt;</span></code>
 
367
emphasis ("<code class="inline"><span class="w">be</span> <span class="w">B</span><span class="q">&lt;careful!&gt;</span></code>
367
368
"), and so on
368
 
("<code class="inline">and that feature is known as <a class="l_w" href="B.html">B</a><span class="q">&lt;autovivification&gt;</span></code>
 
369
("<code class="inline">and <span class="w">that</span> <span class="w">feature</span> <span class="w">is</span> <span class="w">known</span> <span class="w">as</span> <span class="w">B</span><span class="q">&lt;autovivification&gt;</span></code>
369
370
").</p>
370
371
</li>
371
 
<li><a name="'C%3ccode%3e'----code-text-C-C%3c%3e-POD%2c-formatting-code%2c-code-code"></a><b><code class="inline">C<span class="q">&lt;code&gt;</span></code>
 
372
<li><a name="'C%3ccode%3e'----code-text"></a><b><code class="inline"><span class="w">C</span><span class="q">&lt;code&gt;</span></code>
372
373
 -- code text
373
374
   </b>
374
375
<p>Renders code in a typewriter font, or gives some other indication that
375
 
this represents program text ("<code class="inline">C<span class="q">&lt;gmtime($^T)&gt;</span></code>
 
376
this represents program text ("<code class="inline"><span class="w">C</span><span class="q">&lt;gmtime($^T)&gt;</span></code>
376
377
") or some other
377
 
form of computerese ("<code class="inline">C<span class="q">&lt;drwxr-xr-x&gt;</span></code>
 
378
form of computerese ("<code class="inline"><span class="w">C</span><span class="q">&lt;drwxr-xr-x&gt;</span></code>
378
379
").</p>
379
380
</li>
380
 
<li><a name="'L%3cname%3e'----a-hyperlink-L-L%3c%3e-POD%2c-formatting-code%2c-hyperlink-hyperlink"></a><b><code class="inline">L<span class="q">&lt;name&gt;</span></code>
 
381
<li><a name="'L%3cname%3e'----a-hyperlink"></a><b><code class="inline"><span class="w">L</span><span class="q">&lt;name&gt;</span></code>
381
382
 -- a hyperlink
382
383
   </b>
383
384
<p>There are various syntaxes, listed below.  In the syntaxes given,
384
 
<code class="inline">text</code>
385
 
, <code class="inline">name</code>
386
 
, and <code class="inline">section</code>
 
385
<code class="inline"><span class="w">text</span></code>
 
386
, <code class="inline"><span class="w">name</span></code>
 
387
, and <code class="inline"><span class="w">section</span></code>
387
388
 cannot contain the characters
388
389
'/' and '|'; and any '&lt;' or '&gt;' should be matched.</p>
389
390
<ul>
390
391
<li>
391
 
<p><code class="inline">L<span class="q">&lt;name&gt;</span></code>
 
392
<p><code class="inline"><span class="w">L</span><span class="q">&lt;name&gt;</span></code>
392
393
</p>
393
 
<p>Link to a Perl manual page (e.g., <code class="inline">L<span class="q">&lt;Net::Ping&gt;</span></code>
 
394
<p>Link to a Perl manual page (e.g., <code class="inline"><span class="w">L</span><span class="q">&lt;Net::Ping&gt;</span></code>
394
395
).  Note
395
 
that <code class="inline">name</code>
 
396
that <code class="inline"><span class="w">name</span></code>
396
397
 should not contain spaces.  This syntax
397
398
is also occasionally used for references to UNIX man pages, as in
398
 
<code class="inline">L<span class="q">&lt;crontab(5)&gt;</span></code>
 
399
<code class="inline"><span class="w">L</span><span class="q">&lt;crontab(5)&gt;</span></code>
399
400
.</p>
400
401
</li>
401
402
<li>
402
 
<p><code class="inline">L<span class="q">&lt;name/&quot;sec&quot;&gt;</span></code>
403
 
 or <code class="inline">L<span class="q">&lt;name/sec&gt;</span></code>
 
403
<p><code class="inline"><span class="w">L</span><span class="q">&lt;name/&quot;sec&quot;&gt;</span></code>
 
404
 or <code class="inline"><span class="w">L</span><span class="q">&lt;name/sec&gt;</span></code>
404
405
</p>
405
406
<p>Link to a section in other manual page.  E.g.,
406
 
<code class="inline">L<span class="q">&lt;perlsyn/&quot;For Loops&quot;&gt;</span></code>
 
407
<code class="inline"><span class="w">L</span><span class="q">&lt;perlsyn/&quot;For Loops&quot;&gt;</span></code>
407
408
</p>
408
409
</li>
409
410
<li>
410
 
<p><code class="inline">L<span class="q">&lt;/&quot;sec&quot;&gt;</span></code>
411
 
 or <code class="inline">L<span class="q">&lt;/sec&gt;</span></code>
412
 
 or <code class="inline">L<span class="q">&lt;&quot;sec&quot;&gt;</span></code>
 
411
<p><code class="inline"><span class="w">L</span><span class="q">&lt;/&quot;sec&quot;&gt;</span></code>
 
412
 or <code class="inline"><span class="w">L</span><span class="q">&lt;/sec&gt;</span></code>
 
413
 or <code class="inline"><span class="w">L</span><span class="q">&lt;&quot;sec&quot;&gt;</span></code>
413
414
</p>
414
415
<p>Link to a section in this manual page.  E.g.,
415
 
<code class="inline">L<span class="q">&lt;/&quot;Object Methods&quot;&gt;</span></code>
 
416
<code class="inline"><span class="w">L</span><span class="q">&lt;/&quot;Object Methods&quot;&gt;</span></code>
416
417
</p>
417
418
</li>
418
419
</ul>
419
420
<p>A section is started by the named heading or item.  For
420
 
example, <code class="inline">L<span class="q">&lt;perlvar/$.&gt;</span></code>
421
 
 or <code class="inline">L<span class="q">&lt;perlvar/&quot;$.&quot;&gt;</span></code>
 
421
example, <code class="inline"><span class="w">L</span><span class="q">&lt;perlvar/$.&gt;</span></code>
 
422
 or <code class="inline"><span class="w">L</span><span class="q">&lt;perlvar/&quot;$.&quot;&gt;</span></code>
422
423
 both
423
424
link to the section started by "<code class="inline"><span class="pd">=item $.</span></code>
424
425
" in perlvar.  And
425
 
<code class="inline">L<span class="q">&lt;perlsyn/For Loops&gt;</span></code>
426
 
 or <code class="inline">L<span class="q">&lt;perlsyn/&quot;For Loops&quot;&gt;</span></code>
 
426
<code class="inline"><span class="w">L</span><span class="q">&lt;perlsyn/For Loops&gt;</span></code>
 
427
 or <code class="inline"><span class="w">L</span><span class="q">&lt;perlsyn/&quot;For Loops&quot;&gt;</span></code>
427
428
 
428
429
both link to the section started by "<code class="inline"><span class="pd">=head2 For Loops</span></code>
429
430
"
432
433
use "<code class="inline">L&lt;text|...&gt;</code>", as in:</p>
433
434
<ul>
434
435
<li>
435
 
<p><code class="inline">L&lt;text|name&gt;</code>
 
436
<p><code class="inline"><span class="w">L</span>&lt;<span class="w">text</span>|<span class="w">name</span>&gt;</code>
436
437
</p>
437
438
<p>Link this text to that manual page.  E.g.,
438
 
<code class="inline">L&lt;Perl Error Messages|perldiag&gt;</code>
 
439
<code class="inline"><span class="w">L</span>&lt;<span class="w">Perl</span> <span class="w">Error</span> <span class="w">Messages</span>|<span class="w">perldiag</span>&gt;</code>
439
440
</p>
440
441
</li>
441
442
<li>
442
 
<p><code class="inline">L&lt;text|name/"sec"&gt;</code> or <code class="inline">L&lt;text|name/sec&gt;</code>
 
443
<p><code class="inline">L&lt;text|name/"sec"&gt;</code> or <code class="inline"><span class="w">L</span>&lt;<span class="w">text</span>|<span class="w">name</span>/<span class="w">sec</span>&gt;</code>
443
444
</p>
444
445
<p>Link this text to that section in that manual page.  E.g.,
445
 
<code class="inline">L&lt;SWITCH statements|perlsyn/"Basic BLOCKs and Switch
446
 
Statements"&gt;</code></p>
 
446
<code class="inline">L&lt;postfix "if"|perlsyn/"Statement Modifiers"&gt;</code></p>
447
447
</li>
448
448
<li>
449
449
<p><code class="inline">L&lt;text|/"sec"&gt;</code> or <code class="inline">L&lt;text|/sec&gt;</code>
450
 
or <code class="inline">L&lt;text|<span class="q">&quot;sec&quot;</span>&gt;</code>
 
450
or <code class="inline"><span class="w">L</span>&lt;<span class="w">text</span>|<span class="q">&quot;sec&quot;</span>&gt;</code>
451
451
</p>
452
452
<p>Link this text to that section in this manual page.  E.g.,
453
453
<code class="inline">L&lt;the various attributes|/"Member Data"&gt;</code></p>
456
456
<p>Or you can link to a web page:</p>
457
457
<ul>
458
458
<li>
459
 
<p><code class="inline">L<span class="q">&lt;scheme:...&gt;</span></code>
 
459
<p><code class="inline"><span class="w">L</span><span class="q">&lt;scheme:...&gt;</span></code>
460
460
</p>
461
461
<p>Links to an absolute URL.  For example,
462
 
<code class="inline">L<span class="q">&lt;<a href="http://www.perl.org/">http://www.perl.org/</a>&gt;</span></code>
463
 
.  But note
 
462
<code class="inline">L&lt;&lt;a href="http://www.perl.org/"&gt;http://www.perl.org/&lt;/a&gt;&gt;</code>.  But note
464
463
that there is no corresponding <code class="inline">L&lt;text|scheme:...&gt;</code> syntax, for
465
464
various reasons.</p>
466
465
</li>
467
466
</ul>
468
467
</li>
469
 
<li><a name="'E%3cescape%3e'----a-character-escape-E-E%3c%3e-POD%2c-formatting-code%2c-escape-escape"></a><b><code class="inline">E<span class="q">&lt;escape&gt;</span></code>
 
468
<li><a name="'E%3cescape%3e'----a-character-escape"></a><b><code class="inline"><span class="w">E</span><span class="q">&lt;escape&gt;</span></code>
470
469
 -- a character escape
471
470
   </b>
472
 
<p>Very similar to HTML/XML <code class="inline"><span class="i">&amp;foo</span><span class="sc">;</span></code>
473
 
 "entity references":</p>
 
471
<p>Very similar to HTML/XML <code class="inline">&amp;&lt;i&gt;foo&lt;/i&gt;;</code> "entity references":</p>
474
472
<ul>
475
473
<li>
476
 
<p><code class="inline">E<span class="q">&lt;lt&gt;</span></code>
 
474
<p><code class="inline"><span class="w">E</span><span class="q">&lt;lt&gt;</span></code>
477
475
 -- a literal &lt; (less than)</p>
478
476
</li>
479
477
<li>
480
 
<p><code class="inline">E<span class="q">&lt;gt&gt;</span></code>
 
478
<p><code class="inline"><span class="w">E</span><span class="q">&lt;gt&gt;</span></code>
481
479
 -- a literal &gt; (greater than)</p>
482
480
</li>
483
481
<li>
484
 
<p><code class="inline">E<span class="q">&lt;verbar&gt;</span></code>
 
482
<p><code class="inline"><span class="w">E</span><span class="q">&lt;verbar&gt;</span></code>
485
483
 -- a literal | (<i>ver</i>tical <i>bar</i>)</p>
486
484
</li>
487
485
<li>
488
 
<p><code class="inline">E<span class="q">&lt;sol&gt;</span></code>
 
486
<p><code class="inline"><span class="w">E</span><span class="q">&lt;sol&gt;</span></code>
489
487
 = a literal / (<i>sol</i>idus)</p>
490
488
<p>The above four are optional except in other formatting codes,
491
 
notably <code class="inline">L<span class="q">&lt;...&gt;</span></code>
 
489
notably <code class="inline"><span class="w">L</span><span class="q">&lt;...&gt;</span></code>
492
490
, and when preceded by a
493
491
capital letter.</p>
494
492
</li>
495
493
<li>
496
 
<p><code class="inline">E<span class="q">&lt;htmlname&gt;</span></code>
 
494
<p><code class="inline"><span class="w">E</span><span class="q">&lt;htmlname&gt;</span></code>
497
495
</p>
498
 
<p>Some non-numeric HTML entity name, such as <code class="inline">E<span class="q">&lt;eacute&gt;</span></code>
 
496
<p>Some non-numeric HTML entity name, such as <code class="inline"><span class="w">E</span><span class="q">&lt;eacute&gt;</span></code>
499
497
,
500
498
meaning the same thing as <code class="inline"><span class="i">&amp;eacute</span><span class="sc">;</span></code>
501
499
 in HTML -- i.e., a lowercase
502
500
e with an acute (/-shaped) accent.</p>
503
501
</li>
504
502
<li>
505
 
<p><code class="inline">E<span class="q">&lt;number&gt;</span></code>
 
503
<p><code class="inline"><span class="w">E</span><span class="q">&lt;number&gt;</span></code>
506
504
</p>
507
505
<p>The ASCII/Latin-1/Unicode character with that number.  A
508
506
leading "0x" means that <i>number</i> is hex, as in
509
 
<code class="inline">E<span class="q">&lt;0x201E&gt;</span></code>
 
507
<code class="inline"><span class="w">E</span><span class="q">&lt;0x201E&gt;</span></code>
510
508
.  A leading "0" means that <i>number</i> is octal,
511
 
as in <code class="inline">E<span class="q">&lt;075&gt;</span></code>
 
509
as in <code class="inline"><span class="w">E</span><span class="q">&lt;075&gt;</span></code>
512
510
.  Otherwise <i>number</i> is interpreted as being
513
 
in decimal, as in <code class="inline">E<span class="q">&lt;181&gt;</span></code>
 
511
in decimal, as in <code class="inline"><span class="w">E</span><span class="q">&lt;181&gt;</span></code>
514
512
.</p>
515
513
<p>Note that older Pod formatters might not recognize octal or
516
514
hex numeric escapes, and that many formatters cannot reliably
517
515
render characters above 255.  (Some formatters may even have
518
516
to use compromised renderings of Latin-1 characters, like
519
 
rendering <code class="inline">E<span class="q">&lt;eacute&gt;</span></code>
 
517
rendering <code class="inline"><span class="w">E</span><span class="q">&lt;eacute&gt;</span></code>
520
518
 as just a plain "e".)</p>
521
519
</li>
522
520
</ul>
523
521
</li>
524
 
<li><a name="'F%3cfilename%3e'----used-for-filenames-F-F%3c%3e-POD%2c-formatting-code%2c-filename-filename"></a><b><code class="inline">F<span class="q">&lt;filename&gt;</span></code>
 
522
<li><a name="'F%3cfilename%3e'----used-for-filenames"></a><b><code class="inline"><span class="w">F</span><span class="q">&lt;filename&gt;</span></code>
525
523
 -- used for filenames
526
524
   </b>
527
 
<p>Typically displayed in italics.  Example: "<code class="inline">F<span class="q">&lt;.cshrc&gt;</span></code>
 
525
<p>Typically displayed in italics.  Example: "<code class="inline"><span class="w">F</span><span class="q">&lt;.cshrc&gt;</span></code>
528
526
"</p>
529
527
</li>
530
 
<li><a name="'S%3ctext%3e'----text-contains-non-breaking-spaces-S-S%3c%3e-POD%2c-formatting-code%2c-non-breaking-space--non-breaking-space"></a><b><code class="inline">S<span class="q">&lt;text&gt;</span></code>
 
528
<li><a name="'S%3ctext%3e'----text-contains-non-breaking-spaces"></a><b><code class="inline"><span class="w">S</span><span class="q">&lt;text&gt;</span></code>
531
529
 -- text contains non-breaking spaces
532
530
   
533
531
</b>
534
532
<p>This means that the words in <i>text</i> should not be broken
535
 
across lines.  Example: <code&nbsp;class="inline">S&lt;$x&nbsp;?&nbsp;$y&nbsp;:&nbsp;$z&gt;</code>.</p>
 
533
across lines.  Example: <code&nbsp;class="inline"><span&nbsp;class="w">S</span><span&nbsp;class="q">&lt;$x&nbsp;?&nbsp;$y&nbsp;:&nbsp;$z&gt;</span></code>&nbsp;.</p>
536
534
</li>
537
 
<li><a name="'X%3ctopic-name%3e'----an-index-entry-X-X%3c%3e-POD%2c-formatting-code%2c-index-entry-index-entry"></a><b><code class="inline">X<span class="q">&lt;topic name&gt;</span></code>
 
535
<li><a name="'X%3ctopic-name%3e'----an-index-entry"></a><b><code class="inline"><span class="w">X</span><span class="q">&lt;topic name&gt;</span></code>
538
536
 -- an index entry
539
537
   </b>
540
538
<p>This is ignored by most formatters, but some may use it for building
541
539
indexes.  It always renders as empty-string.
542
 
Example: <code class="inline">X<span class="q">&lt;absolutizing relative URLs&gt;</span></code>
 
540
Example: <code class="inline"><span class="w">X</span><span class="q">&lt;absolutizing relative URLs&gt;</span></code>
543
541
</p>
544
542
</li>
545
 
<li><a name="'Z%3c%3e'----a-null-(zero-effect)-formatting-code-Z-Z%3c%3e-POD%2c-formatting-code%2c-null-null"></a><b><code class="inline">Z&lt;&gt;</code>
 
543
<li><a name="'Z%3c%3e'----a-null-(zero-effect)-formatting-code"></a><b><code class="inline"><span class="w">Z</span>&lt;&gt;</code>
546
544
 -- a null (zero-effect) formatting code
547
545
   </b>
548
546
<p>This is rarely used.  It's one way to get around using an
549
547
E&lt;...&gt; code sometimes.  For example, instead of
550
548
"<code class="inline">NE&lt;lt&gt;3</code>" (for "N&lt;3") you could write
551
 
"<code class="inline">NZ&lt;&gt;&lt;<span class="n">3</span></code>
 
549
"<code class="inline"><span class="w">NZ</span>&lt;&gt;&lt;<span class="n">3</span></code>
552
550
" (the "Z&lt;&gt;" breaks up the "N" and
553
551
the "&lt;" so they can't be considered
554
552
the part of a (fictitious) "N&lt;...&gt;" code.</p>
561
559
common when using a formatting code to provide a different font-type for a
562
560
snippet of code.  As with all things in Perl, there is more than
563
561
one way to do it.  One way is to simply escape the closing bracket
564
 
using an <code class="inline">E</code>
 
562
using an <code class="inline"><span class="w">E</span></code>
565
563
 code:</p>
566
564
<pre class="verbatim">    C&lt;$a E&lt;lt&gt;=E&lt;gt&gt; $b&gt;</pre><p>This will produce: "<code class="inline"><span class="i">$a</span> &lt;=&gt; <span class="i">$b</span></code>
567
565
"</p>
573
571
before the closing delimiter!</i>  For example, the following will
574
572
do the trick:
575
573
</p>
576
 
<pre class="verbatim">    C&lt;&lt; <span class="i">$a</span> &lt;=&gt; <span class="i">$b</span> &gt;&gt;</pre>
 
574
<pre class="verbatim">    <span class="w">C</span>&lt;&lt; <span class="i">$a</span> &lt;=&gt; <span class="i">$b</span> &gt;&gt;</pre>
577
575
<p>In fact, you can use as many repeated angle-brackets as you like so
578
576
long as you have the same number of them in the opening and closing
579
577
delimiters, and make sure that whitespace immediately follows the last
581
579
of the closing delimiter.  (The whitespace is ignored.)  So the
582
580
following will also work:
583
581
</p>
584
 
<pre class="verbatim">    C&lt;&lt;&lt; <span class="i">$a</span> &lt;=&gt; <span class="i">$b</span> &gt;&gt;&gt;
585
 
    C&lt;&lt;&lt;&lt;  <span class="i">$a</span> &lt;=&gt; <span class="i">$b</span>     &gt;&gt;&gt;&gt;</pre>
586
 
<p>And they all mean exactly the same as this:</p>
 
582
<pre class="verbatim">    C&lt;&lt;&lt; $a &lt;=&gt; $b &gt;&gt;&gt;
 
583
    C&lt;&lt;&lt;&lt;  $a &lt;=&gt; $b     &gt;&gt;&gt;&gt;</pre><p>And they all mean exactly the same as this:</p>
587
584
<pre class="verbatim">    C&lt;$a E&lt;lt&gt;=E&lt;gt&gt; $b&gt;</pre><p>As a further example, this means that if you wanted to put these bits of
588
 
code in <code class="inline">C</code>
 
585
code in <code class="inline"><span class="w">C</span></code>
589
586
 (code) style:</p>
590
587
<pre class="verbatim">    open(X, "&gt;&gt;thing.dat") || die $!
591
588
    $foo-&gt;bar();</pre><p>you could do it like so:</p>
592
 
<pre class="verbatim">    C&lt;&lt;&lt; <a class="l_k" href="functions/open.html">open</a><span class="s">(</span>X<span class="cm">,</span> <span class="q">&quot;&gt;&gt;thing.dat&quot;</span><span class="s">)</span> || <a class="l_k" href="functions/die.html">die</a> <span class="i">$!</span> &gt;&gt;&gt;
593
 
    C&lt;&lt; <span class="i">$foo</span><span class="i">-&gt;bar</span><span class="s">(</span><span class="s">)</span><span class="sc">;</span> &gt;&gt;</pre>
594
 
<p>which is presumably easier to read than the old way:</p>
 
589
<pre class="verbatim">    C&lt;&lt;&lt; open(X, "&gt;&gt;thing.dat") || die $! &gt;&gt;&gt;
 
590
    C&lt;&lt; $foo-&gt;bar(); &gt;&gt;</pre><p>which is presumably easier to read than the old way:</p>
595
591
<pre class="verbatim">    C&lt;open(X, "E&lt;gt&gt;E&lt;gt&gt;thing.dat") || die $!&gt;
596
592
    C&lt;$foo-E&lt;gt&gt;bar();&gt;</pre><p>This is currently supported by pod2text (Pod::Text), pod2man (Pod::Man),
597
593
and any other pod2xxx or Pod::Xxxx translators that use
598
594
Pod::Parser 1.093 or later, or Pod::Tree 1.02 or later.</p>
599
 
<a name="The-Intent-POD%2c-intent-of"></a><h2>The Intent
 
595
<a name="The-Intent"></a><h2>The Intent
600
596
</h2>
601
597
<p>The intent is simplicity of use, not power of expression.  Paragraphs
602
598
look like paragraphs (block format), so that they stand out
603
 
visually, and so that I could run them through <code class="inline">fmt</code>
 
599
visually, and so that I could run them through <code class="inline"><span class="w">fmt</span></code>
604
600
 easily to reformat
605
601
them (that's F7 in my version of <b>vi</b>, or Esc Q in my version of
606
602
<b>emacs</b>).  I wanted the translator to always leave the <code class="inline">'</code> and <code class="inline">`</code> and
613
609
documentation.  Translators exist for <b>pod2text</b>, <b>pod2html</b>,
614
610
<b>pod2man</b> (that's for nroff(1) and troff(1)), <b>pod2latex</b>, and
615
611
<b>pod2fm</b>.  Various others are available in CPAN.</p>
616
 
<a name="Embedding-Pods-in-Perl-Modules-POD%2c-embedding"></a><h2>Embedding Pods in Perl Modules
 
612
<a name="Embedding-Pods-in-Perl-Modules"></a><h2>Embedding Pods in Perl Modules
617
613
</h2>
618
614
<p>You can embed Pod documentation in your Perl modules and scripts.
619
615
Start your documentation with an empty line, a "=head1" command at the
623
619
you're using an __END__ or __DATA__ cut mark, make sure to put an
624
620
empty line there before the first Pod command.</p>
625
621
<pre class="verbatim"><a name="__END__"></a>  __END__</pre>
626
 
<pre class="verbatim">  =head1 NAME</pre>
 
622
<pre class="verbatim">  =<span class="w">head1</span> <span class="w">NAME</span></pre>
627
623
<pre class="verbatim">  Time::Local - efficiently compute time from local and GMT time</pre><p>Without that empty line before the "=head1", many translators wouldn't
628
624
have recognized the "=head1" as starting a Pod block.</p>
629
625
<a name="Hints-for-Writing-Pod"></a><h2>Hints for Writing Pod</h2>
649
645
command and after every Pod command (including "=cut"!) to be a blank
650
646
line.  Having something like this:</p>
651
647
<pre class="verbatim"> <span class="c"># - - - - - - - - - - - -</span>
652
 
 =item <span class="i">$firecracker</span><span class="i">-&gt;boom</span><span class="s">(</span><span class="s">)</span></pre>
 
648
 =<span class="w">item</span> <span class="i">$firecracker</span><span class="i">-&gt;boom</span><span class="s">(</span><span class="s">)</span></pre>
653
649
<pre class="verbatim"> This noisily detonates the firecracker object.
654
650
 =cut
655
651
 sub boom {
657
653
at all.</p>
658
654
<p>Instead, have it like this:</p>
659
655
<pre class="verbatim"> <span class="c"># - - - - - - - - - - - -</span></pre>
660
 
<pre class="verbatim"> =item <span class="i">$firecracker</span><span class="i">-&gt;boom</span><span class="s">(</span><span class="s">)</span></pre>
661
 
<pre class="verbatim"> This noisily detonates the firecracker object.</pre>
662
 
<pre class="verbatim"> =cut</pre>
 
656
<pre class="verbatim"> =<span class="w">item</span> <span class="i">$firecracker</span><span class="i">-&gt;boom</span><span class="s">(</span><span class="s">)</span></pre>
 
657
<pre class="verbatim"> <span class="w">This</span> <span class="w">noisily</span> <span class="w">detonates</span> <span class="w">the</span> <span class="w">firecracker</span> <span class="w">object</span>.</pre>
 
658
<pre class="verbatim"> =<span class="w">cut</span></pre>
663
659
<pre class="verbatim"> sub boom {
664
660
 ...</pre></li>
665
661
<li>
671
667
</li>
672
668
<li>
673
669
<p>Older translators might add wording around an L&lt;&gt; link, so that
674
 
<code class="inline">L<span class="q">&lt;Foo::Bar&gt;</span></code>
 
670
<code class="inline"><span class="w">L</span><span class="q">&lt;Foo::Bar&gt;</span></code>
675
671
 may become "the Foo::Bar manpage", for example.
676
672
So you shouldn't write things like <code class="inline">the L&lt;foo&gt;
677
673
documentation</code>, if you want the translated document to read sensibly
 
674
-- instead write <code class="inline"><span class="w">the</span> <span class="w">L</span>&lt;<span class="w">Foo::Bar</span>|<span class="w">Foo::Bar</span>&gt; <span class="w">documentation</span></code>
678
675
 or
679
 
<code class="inline">L&lt;the Foo::Bar documentation|Foo::Bar&gt;</code>
 
676
<code class="inline"><span class="w">L</span>&lt;<span class="w">the</span> <span class="w">Foo::Bar</span> <span class="w">documentation</span>|<span class="w">Foo::Bar</span>&gt;</code>
680
677
, to control how the
681
678
link comes out.</p>
682
679
</li>
708
704
          <!--<select name="r"><option value="1" selected>Go to top result<option value="0">Show results list</select>-->
709
705
        </form>
710
706
      </p>
 
707
      <script language="JavaScript" type="text/javascript" src="/perl-version.js"></script>
711
708
      <h2>Labels:</h2>
712
709
      <p>
713
710
        <a href="#" onClick="addLabel('perlpod','perlpod.html')">Add this page</a>