File: perlpodspec.html

package info (click to toggle)
perl-doc-html 5.26.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 39,400 kB
  • sloc: xml: 36; makefile: 7
file content (1654 lines) | stat: -rw-r--r-- 110,789 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>perlpodspec - perldoc.perl.org</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta http-equiv="Content-Language" content="en-gb">
  <link rel="search" type="application/opensearchdescription+xml" title="Search perldoc.perl.org" href="/static/search.xml"/>
  <link href="static/css-20100830.css" rel="stylesheet" rev="stylesheet" type="text/css" media="screen">
  <link href="static/exploreperl.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>

<body onLoad="perldoc.startup();" onPageShow="if (event.persisted) perldoc.startup();">
    <div id="page">
      
      <div id="header">
	<div id="homepage_link">
	  <a href="index.html"></a>
	</div>
	<div id="strapline">
	  Perl Programming Documentation
	</div>
	<div id="download_link" class="download">
	  <a href="http://www.perl.org/get.html">Download Perl</a>
	</div>
	<div id="explore_link" class="download">
	  <a id="explore_anchor" href="#">Explore</a>
	</div>
      </div>
      
      <div id="body">
        <div id="left_column">
          <div class="side_group">
            
	    <div class="side_panel doc_panel">
              <p>Manual</p>
              <ul>
                <li><a href="index-overview.html">Overview</a>
                <li><a href="index-tutorials.html">Tutorials</a>
                <li><a href="index-faq.html">FAQs</a>
                <li><a href="index-history.html">History / Changes</a>
                <li><a href="index-licence.html">License</a>
              </ul>
            </div>
            <div class="side_panel doc_panel">
              <p>Reference</p>
              <ul>
                <li><a href="index-language.html">Language</a>
                <li><a href="index-functions.html">Functions</a>
                <li><a href="perlop.html">Operators</a>
                <li><a href="perlvar.html">Special Variables</a>
                <li><a href="index-pragmas.html">Pragmas</a>
                <li><a href="index-utilities.html">Utilities</a>
                <li><a href="index-internals.html">Internals</a>
                <li><a href="index-platforms.html">Platform Specific</a>
              </ul>
            </div>
            <div class="side_panel doc_panel">
              <p>Modules</p>
              <ul>
		<li>
		
                
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		
                  
		
		
                    <a href="index-modules-A.html">A</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-B.html">B</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-C.html">C</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-D.html">D</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-E.html">E</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-F.html">F</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-G.html">G</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-H.html">H</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-I.html">I</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-L.html">L</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-M.html">M</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-N.html">N</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-O.html">O</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-P.html">P</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-S.html">S</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-T.html">T</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-U.html">U</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-X.html">X</a>
                    
                
              </ul>
            </div>
            
	      <div class="side_panel doc_panel">
		<p>Tools</p>
		<ul>
		  <li><a href="preferences.html">Preferences</a>
		</ul>
	      </div>
            
          </div>
        </div>
        <div id="centre_column">
          <div id="content_header">
            <div id="title_bar">
              <div id="page_name">
                <h1>perlpodspec</h1>
              </div>
              <div id="perl_version">
                Perl 5 version 26.0 documentation
              </div>
              <div class="page_links" id="page_links_top">
                <a href="#" onClick="toolbar.goToTop();return false;">Go to top</a>
		
              </div>
	      <div class="page_links" id="page_links_bottom">
		
                  <a href="#" id="page_index_toggle">Show page index</a> &bull;
		
                <a href="#" id="recent_pages_toggle">Show recent pages</a>		
	      </div>
	      <div id="search_form">
		<form action="search.html" method="GET" id="search">
		  <input type="text" name="q" id="search_box" alt="Search">
		</form>
	      </div>
            </div>
            <div id="breadcrumbs">
                
    <a href="index.html">Home</a> &gt;
    
      
        <a href="index-language.html">Language reference</a> &gt;
      
    
    perlpodspec
  

            </div>
          </div>
          <div id="content_body">
	    <!--[if lt IE 7]>
 <div class="noscript">
   <p>
     <strong>It looks like you're using Internet Explorer 6. This is a very old
     browser which does not offer full support for modern websites.</strong>
   </p>
   <p>
     Unfortunately this means that this website will not work on
     your computer.
   </p>
   <p>
     Don't miss out though! To view the site (and get a better experience from
     many other websites), simply upgrade to
     <a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx">Internet
Explorer 8</a>
     or download an alternative browser such as
     <a href="http://www.mozilla.com/en-US/firefox/firefox.html">Firefox</a>,
     <a href="http://www.apple.com/safari/download/">Safari</a>, or
     <a href="http://www.google.co.uk/chrome">Google Chrome</a>.
   </p>
   <p>
     All of these browsers are free. If you're using a PC at work, you may
     need to contact your IT administrator.
   </p>
 </div>
<![endif]-->
	    <noscript>
	      <div class="noscript">
	      <p>
                <strong>Please note: Many features of this site require JavaScript. You appear to have JavaScript disabled,
	        or are running a non-JavaScript capable web browser.</strong>
	      </p>
	      <p>
		To get the best experience, please enable JavaScript or download a modern web browser such as <a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx">Internet Explorer 8</a>, <a href="http://www.mozilla.com/en-US/firefox/firefox.html">Firefox</a>, <a href="http://www.apple.com/safari/download/">Safari</a>, or <a href="http://www.google.co.uk/chrome">Google Chrome</a>.
              </p>
	      </div>
	    </noscript>

	    <div id="recent_pages" class="hud_container">
	      <div id="recent_pages_header" class="hud_header">
		<div id="recent_pages_close" class="hud_close"><a href="#" onClick="recentPages.hide();return false;"></a></div>
		<div id="recent_pages_title" class="hud_title"><span class="hud_span_top">Recently read</span></div>
		<div id="recent_pages_topright" class="hud_topright"></div>
	      </div>
	      <div id="recent_pages_content" class="hud_content">
	      </div>
	      <div id="recent_pages_footer" class="hud_footer">
		<div id="recent_pages_bottomleft" class="hud_bottomleft"></div>
		<div id="recent_pages_bottom" class="hud_bottom"><span class="hud_span_bottom"></span></div>
		<div id="recent_pages_resize" class="hud_resize"></div>
	      </div>
	    </div>
  
	    <div id="from_search"></div>
            <h1>perlpodspec</h1>


  <!--    -->
<ul><li><a href="#NAME">NAME</a><li><a href="#DESCRIPTION">DESCRIPTION</a><li><a href="#Pod-Definitions">Pod Definitions</a><li><a href="#Pod-Commands">Pod Commands</a><li><a href="#Pod-Formatting-Codes">Pod Formatting Codes</a><li><a href="#Notes-on-Implementing-Pod-Processors">Notes on Implementing Pod Processors</a><li><a href="#About-L%3c...%3e-Codes">About L<...> Codes</a><li><a href="#About-%3dover...%3dback-Regions">About =over...=back Regions</a><li><a href="#About-Data-Paragraphs-and-%22%3dbegin%2f%3dend%22-Regions">About Data Paragraphs and "=begin/=end" Regions</a><li><a href="#SEE-ALSO">SEE ALSO</a><li><a href="#AUTHOR">AUTHOR</a></ul><a name="NAME"></a><h1>NAME</h1>
<p>perlpodspec - Plain Old Documentation: format specification and notes</p>
<a name="DESCRIPTION"></a><h1>DESCRIPTION</h1>
<p>This document is detailed notes on the Pod markup language.  Most
people will only have to read <a href="perlpod.html">perlpod</a> to know how to write
in Pod, but this document may answer some incidental questions to do
with parsing and rendering Pod.</p>
<p>In this document, "must" / "must not", "should" /
"should not", and "may" have their conventional (cf. RFC 2119)
meanings: "X must do Y" means that if X doesn't do Y, it's against
this specification, and should really be fixed.  "X should do Y"
means that it's recommended, but X may fail to do Y, if there's a
good reason.  "X may do Y" is merely a note that X can do Y at
will (although it is up to the reader to detect any connotation of
"and I think it would be <i>nice</i> if X did Y" versus "it wouldn't
really <i>bother</i> me if X did Y").</p>
<p>Notably, when I say "the parser should do Y", the
parser may fail to do Y, if the calling application explicitly
requests that the parser <i>not</i> do Y.  I often phrase this as
"the parser should, by default, do Y."  This doesn't <i>require</i>
the parser to provide an option for turning off whatever
feature Y is (like expanding tabs in verbatim paragraphs), although
it implicates that such an option <i>may</i> be provided.</p>
<a name="Pod-Definitions"></a><h1>Pod Definitions</h1>
<p>Pod is embedded in files, typically Perl source files, although you
can write a file that's nothing but Pod.</p>
<p>A <b>line</b> in a file consists of zero or more non-newline characters,
terminated by either a newline or the end of the file.</p>
<p>A <b>newline sequence</b> is usually a platform-dependent concept, but
Pod parsers should understand it to mean any of CR (ASCII 13), LF
(ASCII 10), or a CRLF (ASCII 13 followed immediately by ASCII 10), in
addition to any other system-specific meaning.  The first CR/CRLF/LF
sequence in the file may be used as the basis for identifying the
newline sequence for parsing the rest of the file.</p>
<p>A <b>blank line</b> is a line consisting entirely of zero or more spaces
(ASCII 32) or tabs (ASCII 9), and terminated by a newline or end-of-file.
A <b>non-blank line</b> is a line containing one or more characters other
than space or tab (and terminated by a newline or end-of-file).</p>
<p>(<i>Note:</i> Many older Pod parsers did not accept a line consisting of
spaces/tabs and then a newline as a blank line. The only lines they
considered blank were lines consisting of <i>no characters at all</i>,
terminated by a newline.)</p>
<p><b>Whitespace</b> is used in this document as a blanket term for spaces,
tabs, and newline sequences.  (By itself, this term usually refers
to literal whitespace.  That is, sequences of whitespace characters
in Pod source, as opposed to "E&lt;32&gt;", which is a formatting
code that <i>denotes</i> a whitespace character.)</p>
<p>A <b>Pod parser</b> is a module meant for parsing Pod (regardless of
whether this involves calling callbacks or building a parse tree or
directly formatting it).  A <b>Pod formatter</b> (or <b>Pod translator</b>)
is a module or program that converts Pod to some other format (HTML,
plaintext, TeX, PostScript, RTF).  A <b>Pod processor</b> might be a
formatter or translator, or might be a program that does something
else with the Pod (like counting words, scanning for index points,
etc.).</p>
<p>Pod content is contained in <b>Pod blocks</b>.  A Pod block starts with a
line that matches <code class="inline"><a class="l_k" href="functions/m.html">m/\A=[a-zA-Z]/</a></code>, and continues up to the next line
that matches <code class="inline"><a class="l_k" href="functions/m.html">m/\A=cut/</a></code> or up to the end of the file if there is
no <code class="inline"><a class="l_k" href="functions/m.html">m/\A=cut/</a></code> line.</p>
<p>Within a Pod block, there are <b>Pod paragraphs</b>.  A Pod paragraph
consists of non-blank lines of text, separated by one or more blank
lines.</p>
<p>For purposes of Pod processing, there are four types of paragraphs in
a Pod block:</p>
<ul>
<li>
<p>A command paragraph (also called a "directive").  The first line of
this paragraph must match <code class="inline"><a class="l_k" href="functions/m.html">m/\A=[a-zA-Z]/</a></code>.  Command paragraphs are
typically one line, as in:</p>
<pre class="verbatim"><ol><li>  =<span class="w">head1</span> <span class="w">NOTES</span></li><li></li><li>  =<span class="w">item</span> *</li></ol></pre><p>But they may span several (non-blank) lines:</p>
<pre class="verbatim"><ol><li>  =for comment</li><li>  Hm, I wonder what it would look like if</li><li>  you tried to write a BNF for Pod from this.</li><li></li><li>  =head3 Dr. Strangelove, or: How I Learned to</li><li>  Stop Worrying and Love the Bomb</li></ol></pre><p><i>Some</i> command paragraphs allow formatting codes in their content
(i.e., after the part that matches <code class="inline"><a class="l_k" href="functions/m.html">m/\A=[a-zA-Z]\S*\s*/</a></code>), as in:</p>
<pre class="verbatim"><ol><li>  =head1 Did You Remember to C&lt;use strict;&gt;?</li></ol></pre><p>In other words, the Pod processing handler for "head1" will apply the
same processing to "Did You Remember to C&lt;use strict;&gt;?" that it
would to an ordinary paragraph (i.e., formatting codes like
"C&lt;...&gt;") are parsed and presumably formatted appropriately, and
whitespace in the form of literal spaces and/or tabs is not
significant.</p>
</li>
<li>
<p>A <b>verbatim paragraph</b>.  The first line of this paragraph must be a
literal space or tab, and this paragraph must not be inside a "=begin
<i>identifier</i>", ... "=end <i>identifier</i>" sequence unless
"<i>identifier</i>" begins with a colon (":").  That is, if a paragraph
starts with a literal space or tab, but <i>is</i> inside a
"=begin <i>identifier</i>", ... "=end <i>identifier</i>" region, then it's
a data paragraph, unless "<i>identifier</i>" begins with a colon.</p>
<p>Whitespace <i>is</i> significant in verbatim paragraphs (although, in
processing, tabs are probably expanded).</p>
</li>
<li>
<p>An <b>ordinary paragraph</b>.  A paragraph is an ordinary paragraph
if its first line matches neither <code class="inline"><a class="l_k" href="functions/m.html">m/\A=[a-zA-Z]/</a></code> nor
<code class="inline"><span class="q">m/\A[ \t]/</span></code>
, <i>and</i> if it's not inside a "=begin <i>identifier</i>",
... "=end <i>identifier</i>" sequence unless "<i>identifier</i>" begins with
a colon (":").</p>
</li>
<li>
<p>A <b>data paragraph</b>.  This is a paragraph that <i>is</i> inside a "=begin
<i>identifier</i>" ... "=end <i>identifier</i>" sequence where
"<i>identifier</i>" does <i>not</i> begin with a literal colon (":").  In
some sense, a data paragraph is not part of Pod at all (i.e.,
effectively it's "out-of-band"), since it's not subject to most kinds
of Pod parsing; but it is specified here, since Pod
parsers need to be able to call an event for it, or store it in some
form in a parse tree, or at least just parse <i>around</i> it.</p>
</li>
</ul>
<p>For example: consider the following paragraphs:</p>
<pre class="verbatim"><ol><li>  <span class="c"># &lt;- that&#39;s the 0th column</span></li><li></li><li>  =<span class="w">head1</span> <span class="w">Foo</span></li><li></li><li>  <span class="w">Stuff</span></li><li></li><li>    <span class="i">$foo</span><span class="i">-&gt;bar</span></li><li></li><li>  =<span class="w">cut</span></li></ol></pre><p>Here, "=head1 Foo" and "=cut" are command paragraphs because the first
line of each matches <code class="inline"><a class="l_k" href="functions/m.html">m/\A=[a-zA-Z]/</a></code>.  "<i>[space][space]</i>$foo-&gt;bar"
is a verbatim paragraph, because its first line starts with a literal
whitespace character (and there's no "=begin"..."=end" region around).</p>
<p>The "=begin <i>identifier</i>" ... "=end <i>identifier</i>" commands stop
paragraphs that they surround from being parsed as ordinary or verbatim
paragraphs, if <i>identifier</i> doesn't begin with a colon.  This
is discussed in detail in the section
<a href="#About-Data-Paragraphs-and-%22%3dbegin%2f%3dend%22-Regions">About Data Paragraphs and =begin/=end Regions</a>.</p>
<a name="Pod-Commands"></a><h1>Pod Commands</h1>
<p>This section is intended to supplement and clarify the discussion in
<a href="perlpod.html#Command-Paragraph">Command Paragraph in perlpod</a>.  These are the currently recognized
Pod commands:</p>
<ul>
<li><a name="%22%3dhead1%22%2c-%22%3dhead2%22%2c-%22%3dhead3%22%2c-%22%3dhead4%22"></a><b>"=head1", "=head2", "=head3", "=head4"</b>
<p>This command indicates that the text in the remainder of the paragraph
is a heading.  That text may contain formatting codes.  Examples:</p>
<pre class="verbatim"><ol><li>  =head1 Object Attributes</li><li></li><li>  =head3 What B&lt;Not&gt; to Do!</li></ol></pre></li>
<li><a name="%22%3dpod%22"></a><b>"=pod"</b>
<p>This command indicates that this paragraph begins a Pod block.  (If we
are already in the middle of a Pod block, this command has no effect at
all.)  If there is any text in this command paragraph after "=pod",
it must be ignored.  Examples:</p>
<pre class="verbatim"><ol><li>  =<span class="w">pod</span></li><li></li><li>  <span class="w">This</span> <span class="w">is</span> <span class="w">a</span> <span class="w">plain</span> <span class="w">Pod</span> <span class="w">paragraph</span>.</li><li></li><li>  =<span class="w">pod</span> <span class="w">This</span> <span class="w">text</span> <span class="w">is</span> <span class="w">ignored</span>.</li></ol></pre></li>
<li><a name="%22%3dcut%22"></a><b>"=cut"</b>
<p>This command indicates that this line is the end of this previously
started Pod block.  If there is any text after "=cut" on the line, it must be
ignored.  Examples:</p>
<pre class="verbatim"><ol><li>  =cut</li><li></li><li>  =cut The documentation ends here.</li><li></li><li>  =cut</li><li>  # This is the first line of program text.</li><li>  sub foo { # This is the second.</li></ol></pre><p>It is an error to try to <i>start</i> a Pod block with a "=cut" command.  In
that case, the Pod processor must halt parsing of the input file, and
must by default emit a warning.</p>
</li>
<li><a name="%22%3dover%22"></a><b>"=over"</b>
<p>This command indicates that this is the start of a list/indent
region.  If there is any text following the "=over", it must consist
of only a nonzero positive numeral.  The semantics of this numeral is
explained in the <a href="#About-%3dover...%3dback-Regions">About =over...=back Regions</a> section, further
below.  Formatting codes are not expanded.  Examples:</p>
<pre class="verbatim"><ol><li>  =<span class="w">over</span> <span class="n">3</span></li><li></li><li>  =<span class="w">over</span> <span class="n">3.5</span></li><li></li><li>  =<span class="w">over</span></li></ol></pre></li>
<li><a name="%22%3ditem%22"></a><b>"=item"</b>
<p>This command indicates that an item in a list begins here.  Formatting
codes are processed.  The semantics of the (optional) text in the
remainder of this paragraph are
explained in the <a href="#About-%3dover...%3dback-Regions">About =over...=back Regions</a> section, further
below.  Examples:</p>
<pre class="verbatim"><ol><li>  =item</li><li></li><li>  =item *</li><li></li><li>  =item      *    </li><li></li><li>  =item 14</li><li></li><li>  =item   3.</li><li></li><li>  =item C&lt;&lt; $thing-&gt;stuff(I&lt;dodad&gt;) &gt;&gt;</li><li></li><li>  =item For transporting us beyond seas to be tried for pretended</li><li>  offenses</li><li></li><li>  =item He is at this time transporting large armies of foreign</li><li>  mercenaries to complete the works of death, desolation and</li><li>  tyranny, already begun with circumstances of cruelty and perfidy</li><li>  scarcely paralleled in the most barbarous ages, and totally</li><li>  unworthy the head of a civilized nation.</li></ol></pre></li>
<li><a name="%22%3dback%22"></a><b>"=back"</b>
<p>This command indicates that this is the end of the region begun
by the most recent "=over" command.  It permits no text after the
"=back" command.</p>
</li>
<li><a name="%22%3dbegin-formatname%22"></a><b>"=begin formatname"</b>
</li>
<li><a name="%22%3dbegin-formatname-parameter%22"></a><b>"=begin formatname parameter"</b>
<p>This marks the following paragraphs (until the matching "=end
formatname") as being for some special kind of processing.  Unless
"formatname" begins with a colon, the contained non-command
paragraphs are data paragraphs.  But if "formatname" <i>does</i> begin
with a colon, then non-command paragraphs are ordinary paragraphs
or data paragraphs.  This is discussed in detail in the section
<a href="#About-Data-Paragraphs-and-%22%3dbegin%2f%3dend%22-Regions">About Data Paragraphs and =begin/=end Regions</a>.</p>
<p>It is advised that formatnames match the regexp
<code class="inline"><a class="l_k" href="functions/m.html">m/\A:?[-a-zA-Z0-9_]+\z/</a></code>.  Everything following whitespace after the
formatname is a parameter that may be used by the formatter when dealing
with this region.  This parameter must not be repeated in the "=end"
paragraph.  Implementors should anticipate future expansion in the
semantics and syntax of the first parameter to "=begin"/"=end"/"=for".</p>
</li>
<li><a name="%22%3dend-formatname%22"></a><b>"=end formatname"</b>
<p>This marks the end of the region opened by the matching
"=begin formatname" region.  If "formatname" is not the formatname
of the most recent open "=begin formatname" region, then this
is an error, and must generate an error message.  This
is discussed in detail in the section
<a href="#About-Data-Paragraphs-and-%22%3dbegin%2f%3dend%22-Regions">About Data Paragraphs and =begin/=end Regions</a>.</p>
</li>
<li><a name="%22%3dfor-formatname-text...%22"></a><b>"=for formatname text..."</b>
<p>This is synonymous with:</p>
<pre class="verbatim"><ol><li>     =<span class="w">begin</span> <span class="w">formatname</span></li><li></li><li>     <span class="w">text</span>...</li><li></li><li>     =<span class="w">end</span> <span class="w">formatname</span></li></ol></pre><p>That is, it creates a region consisting of a single paragraph; that
paragraph is to be treated as a normal paragraph if "formatname"
begins with a ":"; if "formatname" <i>doesn't</i> begin with a colon,
then "text..." will constitute a data paragraph.  There is no way
to use "=for formatname text..." to express "text..." as a verbatim
paragraph.</p>
</li>
<li><a name="%22%3dencoding-encodingname%22"></a><b>"=encoding encodingname"</b>
<p>This command, which should occur early in the document (at least
before any non-US-ASCII data!), declares that this document is
encoded in the encoding <i>encodingname</i>, which must be
an encoding name that <a href="Encode.html">Encode</a> recognizes.  (Encode's list
of supported encodings, in <a href="Encode/Supported.html">Encode::Supported</a>, is useful here.)
If the Pod parser cannot decode the declared encoding, it 
should emit a warning and may abort parsing the document
altogether.</p>
<p>A document having more than one "=encoding" line should be
considered an error.  Pod processors may silently tolerate this if
the not-first "=encoding" lines are just duplicates of the
first one (e.g., if there's a "=encoding utf8" line, and later on
another "=encoding utf8" line).  But Pod processors should complain if
there are contradictory "=encoding" lines in the same document
(e.g., if there is a "=encoding utf8" early in the document and
"=encoding big5" later).  Pod processors that recognize BOMs
may also complain if they see an "=encoding" line
that contradicts the BOM (e.g., if a document with a UTF-16LE
BOM has an "=encoding shiftjis" line).</p>
</li>
</ul>
<p>If a Pod processor sees any command other than the ones listed
above (like "=head", or "=haed1", or "=stuff", or "=cuttlefish",
or "=w123"), that processor must by default treat this as an
error.  It must not process the paragraph beginning with that
command, must by default warn of this as an error, and may
abort the parse.  A Pod parser may allow a way for particular
applications to add to the above list of known commands, and to
stipulate, for each additional command, whether formatting
codes should be processed.</p>
<p>Future versions of this specification may add additional
commands.</p>
<a name="Pod-Formatting-Codes"></a><h1>Pod Formatting Codes</h1>
<p>(Note that in previous drafts of this document and of perlpod,
formatting codes were referred to as "interior sequences", and
this term may still be found in the documentation for Pod parsers,
and in error messages from Pod processors.)</p>
<p>There are two syntaxes for formatting codes:</p>
<ul>
<li>
<p>A formatting code starts with a capital letter (just US-ASCII [A-Z])
followed by a "&lt;", any number of characters, and ending with the first
matching "&gt;".  Examples:</p>
<pre class="verbatim"><ol><li>    That's what I&lt;you&gt; think!</li><li></li><li>    What's C&lt;dump()&gt; for?</li><li></li><li>    X&lt;C&lt;chmod&gt; and C&lt;unlink()&gt; Under Different Operating Systems&gt;</li></ol></pre></li>
<li>
<p>A formatting code starts with a capital letter (just US-ASCII [A-Z])
followed by two or more "&lt;"'s, one or more whitespace characters,
any number of characters, one or more whitespace characters,
and ending with the first matching sequence of two or more "&gt;"'s, where
the number of "&gt;"'s equals the number of "&lt;"'s in the opening of this
formatting code.  Examples:</p>
<pre class="verbatim"><ol><li>    That's what I&lt;&lt; you &gt;&gt; think!</li><li></li><li>    C&lt;&lt;&lt; open(X, "&gt;&gt;thing.dat") || die $! &gt;&gt;&gt;</li><li></li><li>    B&lt;&lt; $foo-&gt;bar(); &gt;&gt;</li></ol></pre><p>With this syntax, the whitespace character(s) after the "C&lt;&lt;&lt;"
and before the "&gt;&gt;&gt;" (or whatever letter) are <i>not</i> renderable. They
do not signify whitespace, are merely part of the formatting codes
themselves.  That is, these are all synonymous:</p>
<pre class="verbatim"><ol><li>    C&lt;thing&gt;</li><li>    C&lt;&lt; thing &gt;&gt;</li><li>    C&lt;&lt;           thing     &gt;&gt;</li><li>    C&lt;&lt;&lt;   thing &gt;&gt;&gt;</li><li>    C&lt;&lt;&lt;&lt;</li><li>    thing</li><li>               &gt;&gt;&gt;&gt;</li></ol></pre><p>and so on.</p>
<p>Finally, the multiple-angle-bracket form does <i>not</i> alter the interpretation
of nested formatting codes, meaning that the following four example lines are
identical in meaning:</p>
<pre class="verbatim"><ol><li>  B&lt;example: C&lt;$a E&lt;lt&gt;=E&lt;gt&gt; $b&gt;&gt;</li><li></li><li>  B&lt;example: C&lt;&lt; $a &lt;=&gt; $b &gt;&gt;&gt;</li><li></li><li>  B&lt;example: C&lt;&lt; $a E&lt;lt&gt;=E&lt;gt&gt; $b &gt;&gt;&gt;</li><li></li><li>  B&lt;&lt;&lt; example: C&lt;&lt; $a E&lt;lt&gt;=E&lt;gt&gt; $b &gt;&gt; &gt;&gt;&gt;</li></ol></pre></li>
</ul>
<p>In parsing Pod, a notably tricky part is the correct parsing of
(potentially nested!) formatting codes.  Implementors should
consult the code in the <code class="inline"><span class="w">parse_text</span></code>
 routine in Pod::Parser as an
example of a correct implementation.</p>
<ul>
<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>
 -- italic text</b>
<p>See the brief discussion in <a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>.</p>
</li>
<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>
 -- bold text</b>
<p>See the brief discussion in <a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>.</p>
</li>
<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>
 -- code text</b>
<p>See the brief discussion in <a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>.</p>
</li>
<li><a name="F%3cfilename%3e----style-for-filenames"></a><b><code class="inline"><span class="w">F</span><span class="q">&lt;filename&gt;</span></code>
 -- style for filenames</b>
<p>See the brief discussion in <a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>.</p>
</li>
<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>
 -- an index entry</b>
<p>See the brief discussion in <a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>.</p>
<p>This code is unusual in that most formatters completely discard
this code and its content.  Other formatters will render it with
invisible codes that can be used in building an index of
the current document.</p>
</li>
<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>
 -- a null (zero-effect) formatting code</b>
<p>Discussed briefly in <a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>.</p>
<p>This code is unusual in that it should have no content.  That is,
a processor may complain if it sees <code class="inline"><span class="w">Z</span><span class="q">&lt;potatoes&gt;</span></code>
.  Whether
or not it complains, the <i>potatoes</i> text should ignored.</p>
</li>
<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>
 -- a hyperlink</b>
<p>The complicated syntaxes of this code are discussed at length in
<a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>, and implementation details are
discussed below, in <a href="#About-L%3c...%3e-Codes">About L&lt;...&gt; Codes</a>.  Parsing the
contents of L&lt;content&gt; is tricky.  Notably, the content has to be
checked for whether it looks like a URL, or whether it has to be split
on literal "|" and/or "/" (in the right order!), and so on,
<i>before</i> E&lt;...&gt; codes are resolved.</p>
</li>
<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>
 -- a character escape</b>
<p>See <a href="perlpod.html#Formatting-Codes">Formatting Codes in perlpod</a>, and several points in
<a href="#Notes-on-Implementing-Pod-Processors">Notes on Implementing Pod Processors</a>.</p>
</li>
<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>
 -- text contains non-breaking spaces</b>
<p>This formatting code is syntactically simple, but semantically
complex.  What it means is that each space in the printable
content of this code signifies a non-breaking space.</p>
<p>Consider:</p>
<pre class="verbatim"><ol><li>    C&lt;$x ? $y    :  $z&gt;</li><li></li><li>    S&lt;C&lt;$x ? $y     :  $z&gt;&gt;</li></ol></pre><p>Both signify the monospace (c[ode] style) text consisting of
"$x", one space, "?", one space, ":", one space, "$z".  The
difference is that in the latter, with the S code, those spaces
are not "normal" spaces, but instead are non-breaking spaces.</p>
</li>
</ul>
<p>If a Pod processor sees any formatting code other than the ones
listed above (as in "N&lt;...&gt;", or "Q&lt;...&gt;", etc.), that
processor must by default treat this as an error.
A Pod parser may allow a way for particular
applications to add to the above list of known formatting codes;
a Pod parser might even allow a way to stipulate, for each additional
command, whether it requires some form of special processing, as
L&lt;...&gt; does.</p>
<p>Future versions of this specification may add additional
formatting codes.</p>
<p>Historical note:  A few older Pod processors would not see a "&gt;" as
closing a "C&lt;" code, if the "&gt;" was immediately preceded by
a "-".  This was so that this:</p>
<pre class="verbatim"><ol><li>    <span class="w">C</span>&lt;<span class="i">$foo</span><span class="i">-&gt;bar</span>&gt;</li></ol></pre><p>would parse as equivalent to this:</p>
<pre class="verbatim"><ol><li>    C&lt;$foo-E&lt;gt&gt;bar&gt;</li></ol></pre><p>instead of as equivalent to a "C" formatting code containing 
only "$foo-", and then a "bar&gt;" outside the "C" formatting code.  This
problem has since been solved by the addition of syntaxes like this:</p>
<pre class="verbatim"><ol><li>    <span class="w">C</span>&lt;&lt; <span class="i">$foo</span><span class="i">-&gt;bar</span> &gt;&gt;</li></ol></pre><p>Compliant parsers must not treat "-&gt;" as special.</p>
<p>Formatting codes absolutely cannot span paragraphs.  If a code is
opened in one paragraph, and no closing code is found by the end of
that paragraph, the Pod parser must close that formatting code,
and should complain (as in "Unterminated I code in the paragraph
starting at line 123: 'Time objects are not...'").  So these
two paragraphs:</p>
<pre class="verbatim"><ol><li>  I&lt;I told you not to do this!</li><li></li><li>  Don't make me say it again!&gt;</li></ol></pre><p>...must <i>not</i> be parsed as two paragraphs in italics (with the I
code starting in one paragraph and starting in another.)  Instead,
the first paragraph should generate a warning, but that aside, the
above code must parse as if it were:</p>
<pre class="verbatim"><ol><li>  I&lt;I told you not to do this!&gt;</li><li></li><li>  Don't make me say it again!E&lt;gt&gt;</li></ol></pre><p>(In SGMLish jargon, all Pod commands are like block-level
elements, whereas all Pod formatting codes are like inline-level
elements.)</p>
<a name="Notes-on-Implementing-Pod-Processors"></a><h1>Notes on Implementing Pod Processors</h1>
<p>The following is a long section of miscellaneous requirements
and suggestions to do with Pod processing.</p>
<ul>
<li>
<p>Pod formatters should tolerate lines in verbatim blocks that are of
any length, even if that means having to break them (possibly several
times, for very long lines) to avoid text running off the side of the
page.  Pod formatters may warn of such line-breaking.  Such warnings
are particularly appropriate for lines are over 100 characters long, which
are usually not intentional.</p>
</li>
<li>
<p>Pod parsers must recognize <i>all</i> of the three well-known newline
formats: CR, LF, and CRLF.  See <a href="perlport.html">perlport</a>.</p>
</li>
<li>
<p>Pod parsers should accept input lines that are of any length.</p>
</li>
<li>
<p>Since Perl recognizes a Unicode Byte Order Mark at the start of files
as signaling that the file is Unicode encoded as in UTF-16 (whether
big-endian or little-endian) or UTF-8, Pod parsers should do the
same.  Otherwise, the character encoding should be understood as
being UTF-8 if the first highbit byte sequence in the file seems
valid as a UTF-8 sequence, or otherwise as CP-1252 (earlier versions of
this specification used Latin-1 instead of CP-1252).</p>
<p>Future versions of this specification may specify
how Pod can accept other encodings.  Presumably treatment of other
encodings in Pod parsing would be as in XML parsing: whatever the
encoding declared by a particular Pod file, content is to be
stored in memory as Unicode characters.</p>
</li>
<li>
<p>The well known Unicode Byte Order Marks are as follows:  if the
file begins with the two literal byte values 0xFE 0xFF, this is
the BOM for big-endian UTF-16.  If the file begins with the two
literal byte value 0xFF 0xFE, this is the BOM for little-endian
UTF-16.  On an ASCII platform, if the file begins with the three literal
byte values
0xEF 0xBB 0xBF, this is the BOM for UTF-8.
A mechanism portable to EBCDIC platforms is to:</p>
<pre class="verbatim"><ol><li>  <a class="l_k" href="functions/my.html">my</a> <span class="i">$utf8_bom</span> = <span class="q">&quot;\x{FEFF}&quot;</span><span class="sc">;</span></li><li>  <span class="i">utf8::encode</span><span class="s">(</span><span class="i">$utf8_bom</span><span class="s">)</span><span class="sc">;</span></li></ol></pre></li>
<li>
<p>A naive, but often sufficient heuristic on ASCII platforms, for testing
the first highbit
byte-sequence in a BOM-less file (whether in code or in Pod!), to see
whether that sequence is valid as UTF-8 (RFC 2279) is to check whether
that the first byte in the sequence is in the range 0xC2 - 0xFD
<i>and</i> whether the next byte is in the range
0x80 - 0xBF.  If so, the parser may conclude that this file is in
UTF-8, and all highbit sequences in the file should be assumed to
be UTF-8.  Otherwise the parser should treat the file as being
in CP-1252.  (A better check, and which works on EBCDIC platforms as
well, is to pass a copy of the sequence to
<a href="utf8.html">utf8::decode()</a> which performs a full validity check on the
sequence and returns TRUE if it is valid UTF-8, FALSE otherwise.  This
function is always pre-loaded, is fast because it is written in C, and
will only get called at most once, so you don't need to avoid it out of
performance concerns.)
In the unlikely circumstance that the first highbit
sequence in a truly non-UTF-8 file happens to appear to be UTF-8, one
can cater to our heuristic (as well as any more intelligent heuristic)
by prefacing that line with a comment line containing a highbit
sequence that is clearly <i>not</i> valid as UTF-8.  A line consisting
of simply "#", an e-acute, and any non-highbit byte,
is sufficient to establish this file's encoding.</p>
</li>
<li>
<p>Pod processors must treat a "=for [label] [content...]" paragraph as
meaning the same thing as a "=begin [label]" paragraph, content, and
an "=end [label]" paragraph.  (The parser may conflate these two
constructs, or may leave them distinct, in the expectation that the
formatter will nevertheless treat them the same.)</p>
</li>
<li>
<p>When rendering Pod to a format that allows comments (i.e., to nearly
any format other than plaintext), a Pod formatter must insert comment
text identifying its name and version number, and the name and
version numbers of any modules it might be using to process the Pod.
Minimal examples:</p>
<pre class="verbatim"><ol><li> <span class="i">%%</span> <span class="w">POD::Pod2PS</span> <span class="v">v3.14159</span><span class="cm">,</span> <span class="w">using</span> <span class="w">POD::Parser</span> <span class="v">v1.92</span></li><li></li><li> &lt;!-- <span class="w">Pod::HTML</span> <span class="v">v3.14159</span><span class="cm">,</span> <span class="w">using</span> <span class="w">POD::Parser</span> <span class="v">v1.92</span> --&gt;</li><li></li><li> <span class="s">{</span>\<span class="w">doccomm</span> <span class="w">generated</span> <span class="w">by</span> <span class="w">Pod::Tree::RTF</span> <span class="n">3.14159</span> <span class="w">using</span> <span class="w">Pod::Tree</span> <span class="n">1.08</span><span class="s">}</span></li><li></li><li> .\<span class="q">&quot; Pod::Man version 3.14159, using POD::Parser version 1.92</span></li></ol></pre><p>Formatters may also insert additional comments, including: the
release date of the Pod formatter program, the contact address for
the author(s) of the formatter, the current time, the name of input
file, the formatting options in effect, version of Perl used, etc.</p>
<p>Formatters may also choose to note errors/warnings as comments,
besides or instead of emitting them otherwise (as in messages to
STDERR, or <code class="inline"><a class="l_k" href="functions/die.html">die</a></code>ing).</p>
</li>
<li>
<p>Pod parsers <i>may</i> emit warnings or error messages ("Unknown E code
E&lt;zslig&gt;!") to STDERR (whether through printing to STDERR, or
<code class="inline"><a class="l_k" href="functions/warn.html">warn</a></code>ing/<code class="inline"><span class="w">carp</span></code>
ing, or <code class="inline"><a class="l_k" href="functions/die.html">die</a></code>ing/<code class="inline"><span class="w">croak</span></code>
ing), but <i>must</i> allow
suppressing all such STDERR output, and instead allow an option for
reporting errors/warnings
in some other way, whether by triggering a callback, or noting errors
in some attribute of the document object, or some similarly unobtrusive
mechanism -- or even by appending a "Pod Errors" section to the end of
the parsed form of the document.</p>
</li>
<li>
<p>In cases of exceptionally aberrant documents, Pod parsers may abort the
parse.  Even then, using <code class="inline"><a class="l_k" href="functions/die.html">die</a></code>ing/<code class="inline"><span class="w">croak</span></code>
ing is to be avoided; where
possible, the parser library may simply close the input file
and add text like "*** Formatting Aborted ***" to the end of the
(partial) in-memory document.</p>
</li>
<li>
<p>In paragraphs where formatting codes (like E&lt;...&gt;, B&lt;...&gt;)
are understood (i.e., <i>not</i> verbatim paragraphs, but <i>including</i>
ordinary paragraphs, and command paragraphs that produce renderable
text, like "=head1"), literal whitespace should generally be considered
"insignificant", in that one literal space has the same meaning as any
(nonzero) number of literal spaces, literal newlines, and literal tabs
(as long as this produces no blank lines, since those would terminate
the paragraph).  Pod parsers should compact literal whitespace in each
processed paragraph, but may provide an option for overriding this
(since some processing tasks do not require it), or may follow
additional special rules (for example, specially treating
period-space-space or period-newline sequences).</p>
</li>
<li>
<p>Pod parsers should not, by default, try to coerce apostrophe (') and
quote (") into smart quotes (little 9's, 66's, 99's, etc), nor try to
turn backtick (`) into anything else but a single backtick character
(distinct from an open quote character!), nor "--" into anything but
two minus signs.  They <i>must never</i> do any of those things to text
in C&lt;...&gt; formatting codes, and never <i>ever</i> to text in verbatim
paragraphs.</p>
</li>
<li>
<p>When rendering Pod to a format that has two kinds of hyphens (-), one
that's a non-breaking hyphen, and another that's a breakable hyphen
(as in "object-oriented", which can be split across lines as
"object-", newline, "oriented"), formatters are encouraged to
generally translate "-" to non-breaking hyphen, but may apply
heuristics to convert some of these to breaking hyphens.</p>
</li>
<li>
<p>Pod formatters should make reasonable efforts to keep words of Perl
code from being broken across lines.  For example, "Foo::Bar" in some
formatting systems is seen as eligible for being broken across lines
as "Foo::" newline "Bar" or even "Foo::-" newline "Bar".  This should
be avoided where possible, either by disabling all line-breaking in
mid-word, or by wrapping particular words with internal punctuation
in "don't break this across lines" codes (which in some formats may
not be a single code, but might be a matter of inserting non-breaking
zero-width spaces between every pair of characters in a word.)</p>
</li>
<li>
<p>Pod parsers should, by default, expand tabs in verbatim paragraphs as
they are processed, before passing them to the formatter or other
processor.  Parsers may also allow an option for overriding this.</p>
</li>
<li>
<p>Pod parsers should, by default, remove newlines from the end of
ordinary and verbatim paragraphs before passing them to the
formatter.  For example, while the paragraph you're reading now
could be considered, in Pod source, to end with (and contain)
the newline(s) that end it, it should be processed as ending with
(and containing) the period character that ends this sentence.</p>
</li>
<li>
<p>Pod parsers, when reporting errors, should make some effort to report
an approximate line number ("Nested E&lt;&gt;'s in Paragraph #52, near
line 633 of Thing/Foo.pm!"), instead of merely noting the paragraph
number ("Nested E&lt;&gt;'s in Paragraph #52 of Thing/Foo.pm!").  Where
this is problematic, the paragraph number should at least be
accompanied by an excerpt from the paragraph ("Nested E&lt;&gt;'s in
Paragraph #52 of Thing/Foo.pm, which begins 'Read/write accessor for
the C&lt;interest rate&gt; attribute...'").</p>
</li>
<li>
<p>Pod parsers, when processing a series of verbatim paragraphs one
after another, should consider them to be one large verbatim
paragraph that happens to contain blank lines.  I.e., these two
lines, which have a blank line between them:</p>
<pre class="verbatim"><ol><li>	<a class="l_k" href="functions/use.html">use</a> <span class="w">Foo</span><span class="sc">;</span></li><li></li><li>	<a class="l_k" href="functions/print.html">print</a> <span class="i">Foo</span><span class="i">-&gt;VERSION</span></li></ol></pre><p>should be unified into one paragraph ("\tuse Foo;\n\n\tprint
Foo-&gt;VERSION") before being passed to the formatter or other
processor.  Parsers may also allow an option for overriding this.</p>
<p>While this might be too cumbersome to implement in event-based Pod
parsers, it is straightforward for parsers that return parse trees.</p>
</li>
<li>
<p>Pod formatters, where feasible, are advised to avoid splitting short
verbatim paragraphs (under twelve lines, say) across pages.</p>
</li>
<li>
<p>Pod parsers must treat a line with only spaces and/or tabs on it as a
"blank line" such as separates paragraphs.  (Some older parsers
recognized only two adjacent newlines as a "blank line" but would not
recognize a newline, a space, and a newline, as a blank line.  This
is noncompliant behavior.)</p>
</li>
<li>
<p>Authors of Pod formatters/processors should make every effort to
avoid writing their own Pod parser.  There are already several in
CPAN, with a wide range of interface styles -- and one of them,
Pod::Simple, comes with modern versions of Perl.</p>
</li>
<li>
<p>Characters in Pod documents may be conveyed either as literals, or by
number in E&lt;n&gt; codes, or by an equivalent mnemonic, as in
E&lt;eacute&gt; which is exactly equivalent to E&lt;233&gt;.  The numbers
are the Latin1/Unicode values, even on EBCDIC platforms.</p>
<p>When referring to characters by using a E&lt;n&gt; numeric code, numbers
in the range 32-126 refer to those well known US-ASCII characters (also
defined there by Unicode, with the same meaning), which all Pod
formatters must render faithfully.  Characters whose E&lt;&gt; numbers
are in the ranges 0-31 and 127-159 should not be used (neither as
literals,
nor as E&lt;number&gt; codes), except for the literal byte-sequences for
newline (ASCII 13, ASCII 13 10, or ASCII 10), and tab (ASCII 9).</p>
<p>Numbers in the range 160-255 refer to Latin-1 characters (also
defined there by Unicode, with the same meaning).  Numbers above
255 should be understood to refer to Unicode characters.</p>
</li>
<li>
<p>Be warned
that some formatters cannot reliably render characters outside 32-126;
and many are able to handle 32-126 and 160-255, but nothing above
255.</p>
</li>
<li>
<p>Besides the well-known "E&lt;lt&gt;" and "E&lt;gt&gt;" codes for
less-than and greater-than, Pod parsers must understand "E&lt;sol&gt;"
for "/" (solidus, slash), and "E&lt;verbar&gt;" for "|" (vertical bar,
pipe).  Pod parsers should also understand "E&lt;lchevron&gt;" and
"E&lt;rchevron&gt;" as legacy codes for characters 171 and 187, i.e.,
"left-pointing double angle quotation mark" = "left pointing
guillemet" and "right-pointing double angle quotation mark" = "right
pointing guillemet".  (These look like little "&lt;&lt;" and "&gt;&gt;", and they
are now preferably expressed with the HTML/XHTML codes "E&lt;laquo&gt;"
and "E&lt;raquo&gt;".)</p>
</li>
<li>
<p>Pod parsers should understand all "E&lt;html&gt;" codes as defined
in the entity declarations in the most recent XHTML specification at
<code class="inline"><span class="w">www</span>.<span class="w">W3</span>.<span class="w">org</span></code>
.  Pod parsers must understand at least the entities
that define characters in the range 160-255 (Latin-1).  Pod parsers,
when faced with some unknown "E&lt;<i>identifier</i>&gt;" code,
shouldn't simply replace it with nullstring (by default, at least),
but may pass it through as a string consisting of the literal characters
E, less-than, <i>identifier</i>, greater-than.  Or Pod parsers may offer the
alternative option of processing such unknown
"E&lt;<i>identifier</i>&gt;" codes by firing an event especially
for such codes, or by adding a special node-type to the in-memory
document tree.  Such "E&lt;<i>identifier</i>&gt;" may have special meaning
to some processors, or some processors may choose to add them to
a special error report.</p>
</li>
<li>
<p>Pod parsers must also support the XHTML codes "E&lt;quot&gt;" for
character 34 (doublequote, "), "E&lt;amp&gt;" for character 38
(ampersand, &amp;), and "E&lt;apos&gt;" for character 39 (apostrophe, ').</p>
</li>
<li>
<p>Note that in all cases of "E&lt;whatever&gt;", <i>whatever</i> (whether
an htmlname, or a number in any base) must consist only of
alphanumeric characters -- that is, <i>whatever</i> must match
<code class="inline"><a class="l_k" href="functions/m.html">m/\A\w+\z/</a></code>.  So "E&lt; 0 1 2 3 &gt;" is invalid, because
it contains spaces, which aren't alphanumeric characters.  This
presumably does not <i>need</i> special treatment by a Pod processor;
" 0 1 2 3 " doesn't look like a number in any base, so it would
presumably be looked up in the table of HTML-like names.  Since
there isn't (and cannot be) an HTML-like entity called " 0 1 2 3 ",
this will be treated as an error.  However, Pod processors may
treat "E&lt; 0 1 2 3 &gt;" or "E&lt;e-acute&gt;" as <i>syntactically</i>
invalid, potentially earning a different error message than the
error message (or warning, or event) generated by a merely unknown
(but theoretically valid) htmlname, as in "E&lt;qacute&gt;"
[sic].  However, Pod parsers are not required to make this
distinction.</p>
</li>
<li>
<p>Note that E&lt;number&gt; <i>must not</i> be interpreted as simply
"codepoint <i>number</i> in the current/native character set".  It always
means only "the character represented by codepoint <i>number</i> in
Unicode."  (This is identical to the semantics of &amp;#<i>number</i>; in XML.)</p>
<p>This will likely require many formatters to have tables mapping from
treatable Unicode codepoints (such as the "\xE9" for the e-acute
character) to the escape sequences or codes necessary for conveying
such sequences in the target output format.  A converter to *roff
would, for example know that "\xE9" (whether conveyed literally, or via
a E&lt;...&gt; sequence) is to be conveyed as "e\\*'".
Similarly, a program rendering Pod in a Mac OS application window, would
presumably need to know that "\xE9" maps to codepoint 142 in MacRoman
encoding that (at time of writing) is native for Mac OS.  Such
Unicode2whatever mappings are presumably already widely available for
common output formats.  (Such mappings may be incomplete!  Implementers
are not expected to bend over backwards in an attempt to render
Cherokee syllabics, Etruscan runes, Byzantine musical symbols, or any
of the other weird things that Unicode can encode.)  And
if a Pod document uses a character not found in such a mapping, the
formatter should consider it an unrenderable character.</p>
</li>
<li>
<p>If, surprisingly, the implementor of a Pod formatter can't find a
satisfactory pre-existing table mapping from Unicode characters to
escapes in the target format (e.g., a decent table of Unicode
characters to *roff escapes), it will be necessary to build such a
table.  If you are in this circumstance, you should begin with the
characters in the range 0x00A0 - 0x00FF, which is mostly the heavily
used accented characters.  Then proceed (as patience permits and
fastidiousness compels) through the characters that the (X)HTML
standards groups judged important enough to merit mnemonics
for.  These are declared in the (X)HTML specifications at the
www.W3.org site.  At time of writing (September 2001), the most recent
entity declaration files are:</p>
<pre class="verbatim"><ol><li>  http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent</li><li>  http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</li><li>  http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</li></ol></pre><p>Then you can progress through any remaining notable Unicode characters
in the range 0x2000-0x204D (consult the character tables at
www.unicode.org), and whatever else strikes your fancy.  For example,
in <i>xhtml-symbol.ent</i>, there is the entry:</p>
<pre class="verbatim"><ol><li>  &lt;!ENTITY infin    "&amp;#8734;"&gt; &lt;!-- infinity, U+221E ISOtech --&gt;</li></ol></pre><p>While the mapping "infin" to the character "\x{221E}" will (hopefully)
have been already handled by the Pod parser, the presence of the
character in this file means that it's reasonably important enough to
include in a formatter's table that maps from notable Unicode characters
to the codes necessary for rendering them.  So for a Unicode-to-*roff
mapping, for example, this would merit the entry:</p>
<pre class="verbatim"><ol><li>  <span class="q">&quot;\x{221E}&quot;</span> <span class="cm">=&gt;</span> <span class="q">&#39;\(in&#39;</span><span class="cm">,</span></li></ol></pre><p>It is eagerly hoped that in the future, increasing numbers of formats
(and formatters) will support Unicode characters directly (as (X)HTML
does with <code class="inline"><span class="i">&amp;infin</span><span class="sc">;</span></code>
, <code class="inline">&amp;#8734;</code>, or <code class="inline">&amp;#x221E;</code>), reducing the need
for idiosyncratic mappings of Unicode-to-<i>my_escapes</i>.</p>
</li>
<li>
<p>It is up to individual Pod formatter to display good judgement when
confronted with an unrenderable character (which is distinct from an
unknown E&lt;thing&gt; sequence that the parser couldn't resolve to
anything, renderable or not).  It is good practice to map Latin letters
with diacritics (like "E&lt;eacute&gt;"/"E&lt;233&gt;") to the corresponding
unaccented US-ASCII letters (like a simple character 101, "e"), but
clearly this is often not feasible, and an unrenderable character may
be represented as "?", or the like.  In attempting a sane fallback
(as from E&lt;233&gt; to "e"), Pod formatters may use the
%Latin1Code_to_fallback table in <a href="Pod/Escapes.html">Pod::Escapes</a>, or
<a href="http://search.cpan.org/perldoc/Text::Unidecode">Text::Unidecode</a>, if available.</p>
<p>For example, this Pod text:</p>
<pre class="verbatim"><ol><li>  magic is enabled if you set C&lt;$Currency&gt; to 'E&lt;euro&gt;'.</li></ol></pre><p>may be rendered as:
"magic is enabled if you set <code class="inline"><span class="i">$Currency</span></code>
 to '<i>?</i>'" or as
"magic is enabled if you set <code class="inline"><span class="i">$Currency</span></code>
 to '<b>[euro]</b>'", or as
"magic is enabled if you set <code class="inline"><span class="i">$Currency</span></code>
 to '[x20AC]', etc.</p>
<p>A Pod formatter may also note, in a comment or warning, a list of what
unrenderable characters were encountered.</p>
</li>
<li>
<p>E&lt;...&gt; may freely appear in any formatting code (other than
in another E&lt;...&gt; or in an Z&lt;&gt;).  That is, "X&lt;The
E&lt;euro&gt;1,000,000 Solution&gt;" is valid, as is "L&lt;The
E&lt;euro&gt;1,000,000 Solution|Million::Euros&gt;".</p>
</li>
<li>
<p>Some Pod formatters output to formats that implement non-breaking
spaces as an individual character (which I'll call "NBSP"), and
others output to formats that implement non-breaking spaces just as
spaces wrapped in a "don't break this across lines" code.  Note that
at the level of Pod, both sorts of codes can occur: Pod can contain a
NBSP character (whether as a literal, or as a "E&lt;160&gt;" or
"E&lt;nbsp&gt;" code); and Pod can contain "S&lt;foo
I&lt;bar&gt; baz&gt;" codes, where "mere spaces" (character 32) in
such codes are taken to represent non-breaking spaces.  Pod
parsers should consider supporting the optional parsing of "S&lt;foo
I&lt;bar&gt; baz&gt;" as if it were
"foo<i>NBSP</i>I&lt;bar&gt;<i>NBSP</i>baz", and, going the other way, the
optional parsing of groups of words joined by NBSP's as if each group
were in a S&lt;...&gt; code, so that formatters may use the
representation that maps best to what the output format demands.</p>
</li>
<li>
<p>Some processors may find that the <code class="inline"><span class="w">S</span><span class="q">&lt;...&gt;</span></code>
 code is easiest to
implement by replacing each space in the parse tree under the content
of the S, with an NBSP.  But note: the replacement should apply <i>not</i> to
spaces in <i>all</i> text, but <i>only</i> to spaces in <i>printable</i> text.  (This
distinction may or may not be evident in the particular tree/event
model implemented by the Pod parser.)  For example, consider this
unusual case:</p>
<pre class="verbatim"><ol><li>   <span class="w">S</span>&lt;<span class="w">L</span><span class="q">&lt;/Autoloaded Functions&gt;</span>&gt;</li></ol></pre><p>This means that the space in the middle of the visible link text must
not be broken across lines.  In other words, it's the same as this:</p>
<pre class="verbatim"><ol><li>   <span class="w">L</span>&lt;<span class="q">&quot;AutoloadedE&lt;160&gt;Functions&quot;</span>/<span class="w">Autoloaded</span> <span class="w">Functions</span>&gt;</li></ol></pre><p>However, a misapplied space-to-NBSP replacement could (wrongly)
produce something equivalent to this:</p>
<pre class="verbatim"><ol><li>   L&lt;"AutoloadedE&lt;160&gt;Functions"/AutoloadedE&lt;160&gt;Functions&gt;</li></ol></pre><p>...which is almost definitely not going to work as a hyperlink (assuming
this formatter outputs a format supporting hypertext).</p>
<p>Formatters may choose to just not support the S format code,
especially in cases where the output format simply has no NBSP
character/code and no code for "don't break this stuff across lines".</p>
</li>
<li>
<p>Besides the NBSP character discussed above, implementors are reminded
of the existence of the other "special" character in Latin-1, the
"soft hyphen" character, also known as "discretionary hyphen",
i.e. <code class="inline"><span class="w">E</span><span class="q">&lt;173&gt;</span></code>
 = <code class="inline"><span class="w">E</span><span class="q">&lt;0xAD&gt;</span></code>
 =
<code class="inline"><span class="w">E</span><span class="q">&lt;shy&gt;</span></code>
).  This character expresses an optional hyphenation
point.  That is, it normally renders as nothing, but may render as a
"-" if a formatter breaks the word at that point.  Pod formatters
should, as appropriate, do one of the following:  1) render this with
a code with the same meaning (e.g., "\-" in RTF), 2) pass it through
in the expectation that the formatter understands this character as
such, or 3) delete it.</p>
<p>For example:</p>
<pre class="verbatim"><ol><li>  sigE&lt;shy&gt;action</li><li>  manuE&lt;shy&gt;script</li><li>  JarkE&lt;shy&gt;ko HieE&lt;shy&gt;taE&lt;shy&gt;nieE&lt;shy&gt;mi</li></ol></pre><p>These signal to a formatter that if it is to hyphenate "sigaction"
or "manuscript", then it should be done as
"sig-<i>[linebreak]</i>action" or "manu-<i>[linebreak]</i>script"
(and if it doesn't hyphenate it, then the <code class="inline"><span class="w">E</span><span class="q">&lt;shy&gt;</span></code>
 doesn't
show up at all).  And if it is
to hyphenate "Jarkko" and/or "Hietaniemi", it can do
so only at the points where there is a <code class="inline"><span class="w">E</span><span class="q">&lt;shy&gt;</span></code>
 code.</p>
<p>In practice, it is anticipated that this character will not be used
often, but formatters should either support it, or delete it.</p>
</li>
<li>
<p>If you think that you want to add a new command to Pod (like, say, a
"=biblio" command), consider whether you could get the same
effect with a for or begin/end sequence: "=for biblio ..." or "=begin
biblio" ... "=end biblio".  Pod processors that don't understand
"=for biblio", etc, will simply ignore it, whereas they may complain
loudly if they see "=biblio".</p>
</li>
<li>
<p>Throughout this document, "Pod" has been the preferred spelling for
the name of the documentation format.  One may also use "POD" or
"pod".  For the documentation that is (typically) in the Pod
format, you may use "pod", or "Pod", or "POD".  Understanding these
distinctions is useful; but obsessing over how to spell them, usually
is not.</p>
</li>
</ul>
<a name="About-L%3c...%3e-Codes"></a><h1>About L&lt;...&gt; Codes</h1>
<p>As you can tell from a glance at <a href="perlpod.html">perlpod</a>, the L&lt;...&gt;
code is the most complex of the Pod formatting codes.  The points below
will hopefully clarify what it means and how processors should deal
with it.</p>
<ul>
<li>
<p>In parsing an L&lt;...&gt; code, Pod parsers must distinguish at least
four attributes:</p>
<ul>
<li><a name="First%3a"></a><b>First:</b>
<p>The link-text.  If there is none, this must be <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code>.  (E.g., in
"L&lt;Perl Functions|perlfunc&gt;", the link-text is "Perl Functions".
In "L&lt;Time::HiRes&gt;" and even "L&lt;|Time::HiRes&gt;", there is no
link text.  Note that link text may contain formatting.)</p>
</li>
<li><a name="Second%3a"></a><b>Second:</b>
<p>The possibly inferred link-text; i.e., if there was no real link
text, then this is the text that we'll infer in its place.  (E.g., for
"L&lt;Getopt::Std&gt;", the inferred link text is "Getopt::Std".)</p>
</li>
<li><a name="Third%3a"></a><b>Third:</b>
<p>The name or URL, or <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code> if none.  (E.g., in "L&lt;Perl
Functions|perlfunc&gt;", the name (also sometimes called the page)
is "perlfunc".  In "L&lt;/CAVEATS&gt;", the name is <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code>.)</p>
</li>
<li><a name="Fourth%3a"></a><b>Fourth:</b>
<p>The section (AKA "item" in older perlpods), or <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code> if none.  E.g.,
in "L&lt;Getopt::Std/DESCRIPTION&gt;", "DESCRIPTION" is the section.  (Note
that this is not the same as a manpage section like the "5" in "man 5
crontab".  "Section Foo" in the Pod sense means the part of the text
that's introduced by the heading or item whose text is "Foo".)</p>
</li>
</ul>
<p>Pod parsers may also note additional attributes including:</p>
<ul>
<li><a name="Fifth%3a"></a><b>Fifth:</b>
<p>A flag for whether item 3 (if present) is a URL (like
"<a href="http://lists.perl.org">http://lists.perl.org</a>" is), in which case there should be no section
attribute; a Pod name (like "perldoc" and "Getopt::Std" are); or
possibly a man page name (like "crontab(5)" is).</p>
</li>
<li><a name="Sixth%3a"></a><b>Sixth:</b>
<p>The raw original L&lt;...&gt; content, before text is split on
"|", "/", etc, and before E&lt;...&gt; codes are expanded.</p>
</li>
</ul>
<p>(The above were numbered only for concise reference below.  It is not
a requirement that these be passed as an actual list or array.)</p>
<p>For example:</p>
<pre class="verbatim"><ol><li>  <span class="w">L</span><span class="q">&lt;Foo::Bar&gt;</span></li><li>    <span class="cm">=&gt;</span>  <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># link text</span></li><li>        <span class="q">&quot;Foo::Bar&quot;</span><span class="cm">,</span>                    <span class="c"># possibly inferred link text</span></li><li>        <span class="q">&quot;Foo::Bar&quot;</span><span class="cm">,</span>                    <span class="c"># name</span></li><li>        <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># section</span></li><li>        <span class="q">&#39;pod&#39;</span><span class="cm">,</span>                         <span class="c"># what sort of link</span></li><li>        <span class="q">&quot;Foo::Bar&quot;</span>                     <span class="c"># original content</span></li><li></li><li>  <span class="w">L</span>&lt;<span class="w">Perlport&#39;s</span> <span class="w">section</span> <span class="w">on</span> <span class="w">NL&#39;s</span>|<span class="w">perlport</span>/<span class="w">Newlines</span>&gt;</li><li>    <span class="cm">=&gt;</span>  <span class="q">&quot;Perlport&#39;s section on NL&#39;s&quot;</span><span class="cm">,</span>  <span class="c"># link text</span></li><li>        <span class="q">&quot;Perlport&#39;s section on NL&#39;s&quot;</span><span class="cm">,</span>  <span class="c"># possibly inferred link text</span></li><li>        <span class="q">&quot;perlport&quot;</span><span class="cm">,</span>                    <span class="c"># name</span></li><li>        <span class="q">&quot;Newlines&quot;</span><span class="cm">,</span>                    <span class="c"># section</span></li><li>        <span class="q">&#39;pod&#39;</span><span class="cm">,</span>                         <span class="c"># what sort of link</span></li><li>        <span class="q">&quot;Perlport&#39;s section on NL&#39;s|perlport/Newlines&quot;</span></li><li>                                       <span class="c"># original content</span></li><li></li><li>  <span class="w">L</span><span class="q">&lt;perlport/Newlines&gt;</span></li><li>    <span class="cm">=&gt;</span>  <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># link text</span></li><li>        <span class="q">&#39;&quot;Newlines&quot; in perlport&#39;</span><span class="cm">,</span>      <span class="c"># possibly inferred link text</span></li><li>        <span class="q">&quot;perlport&quot;</span><span class="cm">,</span>                    <span class="c"># name</span></li><li>        <span class="q">&quot;Newlines&quot;</span><span class="cm">,</span>                    <span class="c"># section</span></li><li>        <span class="q">&#39;pod&#39;</span><span class="cm">,</span>                         <span class="c"># what sort of link</span></li><li>        <span class="q">&quot;perlport/Newlines&quot;</span>            <span class="c"># original content</span></li><li></li><li>  <span class="w">L</span><span class="q">&lt;crontab(5)/&quot;DESCRIPTION&quot;&gt;</span></li><li>    <span class="cm">=&gt;</span>  <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># link text</span></li><li>        <span class="q">&#39;&quot;DESCRIPTION&quot; in crontab(5)&#39;</span><span class="cm">,</span> <span class="c"># possibly inferred link text</span></li><li>        <span class="q">&quot;crontab(5)&quot;</span><span class="cm">,</span>                  <span class="c"># name</span></li><li>        <span class="q">&quot;DESCRIPTION&quot;</span><span class="cm">,</span>                 <span class="c"># section</span></li><li>        <span class="q">&#39;man&#39;</span><span class="cm">,</span>                         <span class="c"># what sort of link</span></li><li>        <span class="q">&#39;crontab(5)/&quot;DESCRIPTION&quot;&#39;</span>     <span class="c"># original content</span></li><li></li><li>  <span class="w">L</span><span class="q">&lt;/Object Attributes&gt;</span></li><li>    <span class="cm">=&gt;</span>  <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># link text</span></li><li>        <span class="q">&#39;&quot;Object Attributes&quot;&#39;</span><span class="cm">,</span>         <span class="c"># possibly inferred link text</span></li><li>        <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># name</span></li><li>        <span class="q">&quot;Object Attributes&quot;</span><span class="cm">,</span>           <span class="c"># section</span></li><li>        <span class="q">&#39;pod&#39;</span><span class="cm">,</span>                         <span class="c"># what sort of link</span></li><li>        <span class="q">&quot;/Object Attributes&quot;</span>           <span class="c"># original content</span></li><li></li><li>  <span class="w">L</span><span class="q">&lt;<a href="http://www.perl.org/">http://www.perl.org/</a>&gt;</span></li><li>    <span class="cm">=&gt;</span>  <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># link text</span></li><li>        <span class="q">&quot;<a href="http://www.perl.org/">http://www.perl.org/</a>&quot;</span><span class="cm">,</span>        <span class="c"># possibly inferred link text</span></li><li>        <span class="q">&quot;<a href="http://www.perl.org/">http://www.perl.org/</a>&quot;</span><span class="cm">,</span>        <span class="c"># name</span></li><li>        <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span>                         <span class="c"># section</span></li><li>        <span class="q">&#39;url&#39;</span><span class="cm">,</span>                         <span class="c"># what sort of link</span></li><li>        <span class="q">&quot;<a href="http://www.perl.org/">http://www.perl.org/</a>&quot;</span>         <span class="c"># original content</span></li><li></li><li>  <span class="w">L</span>&lt;<span class="w">Perl</span>.<span class="w">org</span>|<span class="w">http</span><span class="co">:</span><span class="q">//</span><span class="w">www</span>.<span class="w">perl</span>.<span class="w">org</span><span class="q">/&gt;</span></li><li>    <span class="q">    =&gt;  &quot;Perl.org&quot;,                    # link text</span></li><li>        <span class="q">        &quot;http:/</span>/<span class="w">www</span>.<span class="w">perl</span>.<span class="w">org</span><span class="q">/&quot;,        # possibly inferred link text</span></li><li>        <span class="q">        &quot;http:/</span>/<span class="w">www</span>.<span class="w">perl</span>.<span class="w">org</span><span class="q">/&quot;,        # name</span></li><li>        <span class="q">        undef,                         # section</span></li><li>        <span class="q">        &#39;url&#39;,                         # what sort of link</span></li><li>        <span class="q">        &quot;Perl.org|http:/</span>/<span class="w">www</span>.<span class="w">perl</span>.<span class="w">org</span><span class="q">/&quot; # original content</span></li></ol></pre><p>Note that you can distinguish URL-links from anything else by the
fact that they match <code class="inline"><a class="l_k" href="functions/m.html">m/\A\w+:[^:\s]\S*\z/</a></code>.  So
<code class="inline">L&lt;<a href="http://www.perl.com">http://www.perl.com</a>&gt;</code> is a URL, but
<code class="inline"><span class="w">L</span><span class="q">&lt;HTTP::Response&gt;</span></code>
 isn't.</p>
</li>
<li>
<p>In case of L&lt;...&gt; codes with no "text|" part in them,
older formatters have exhibited great variation in actually displaying
the link or cross reference.  For example, L&lt;crontab(5)&gt; would render
as "the <code class="inline"><span class="i">crontab</span><span class="s">(</span><span class="n">5</span><span class="s">)</span></code>
 manpage", or "in the <code class="inline"><span class="i">crontab</span><span class="s">(</span><span class="n">5</span><span class="s">)</span></code>
 manpage"
or just "<code class="inline"><span class="i">crontab</span><span class="s">(</span><span class="n">5</span><span class="s">)</span></code>
".</p>
<p>Pod processors must now treat "text|"-less links as follows:</p>
<pre class="verbatim"><ol><li>  L&lt;name&gt;         =&gt;  L&lt;name|name&gt;</li><li>  L&lt;/section&gt;     =&gt;  L&lt;"section"|/section&gt;</li><li>  L&lt;name/section&gt; =&gt;  L&lt;"section" in name|name/section&gt;</li></ol></pre></li>
<li>
<p>Note that section names might contain markup.  I.e., if a section
starts with:</p>
<pre class="verbatim"><ol><li>  =head2 About the C&lt;-M&gt; Operator</li></ol></pre><p>or with:</p>
<pre class="verbatim"><ol><li>  =item About the C&lt;-M&gt; Operator</li></ol></pre><p>then a link to it would look like this:</p>
<pre class="verbatim"><ol><li>  L&lt;somedoc/About the C&lt;-M&gt; Operator&gt;</li></ol></pre><p>Formatters may choose to ignore the markup for purposes of resolving
the link and use only the renderable characters in the section name,
as in:</p>
<pre class="verbatim"><ol><li>  &lt;h1&gt;&lt;a name="About_the_-M_Operator"&gt;About the &lt;code&gt;-M&lt;/code&gt;</li><li>  Operator&lt;/h1&gt;</li><li></li><li>  ...</li><li></li><li>  &lt;a href="somedoc#About_the_-M_Operator"&gt;About the &lt;code&gt;-M&lt;/code&gt;</li><li>  Operator" in somedoc&lt;/a&gt;</li></ol></pre></li>
<li>
<p>Previous versions of perlpod distinguished <code class="inline"><span class="w">L</span><span class="q">&lt;name/&quot;section&quot;&gt;</span></code>

links from <code class="inline"><span class="w">L</span><span class="q">&lt;name/item&gt;</span></code>
 links (and their targets).  These
have been merged syntactically and semantically in the current
specification, and <i>section</i> can refer either to a "=head<i>n</i> Heading
Content" command or to a "=item Item Content" command.  This
specification does not specify what behavior should be in the case
of a given document having several things all seeming to produce the
same <i>section</i> identifier (e.g., in HTML, several things all producing
the same <i>anchorname</i> in &lt;a name="<i>anchorname</i>"&gt;...&lt;/a&gt;
elements).  Where Pod processors can control this behavior, they should
use the first such anchor.  That is, <code class="inline"><span class="w">L</span><span class="q">&lt;Foo/Bar&gt;</span></code>
 refers to the
<i>first</i> "Bar" section in Foo.</p>
<p>But for some processors/formats this cannot be easily controlled; as
with the HTML example, the behavior of multiple ambiguous
&lt;a name="<i>anchorname</i>"&gt;...&lt;/a&gt; is most easily just left up to
browsers to decide.</p>
</li>
<li>
<p>In a <code class="inline">L&lt;text|...&gt;</code> code, text may contain formatting codes
for formatting or for E&lt;...&gt; escapes, as in:</p>
<pre class="verbatim"><ol><li>  L&lt;B&lt;ummE&lt;234&gt;stuff&gt;|...&gt;</li></ol></pre><p>For <code class="inline"><span class="w">L</span><span class="q">&lt;...&gt;</span></code>
 codes without a "name|" part, only
<code class="inline"><span class="w">E</span><span class="q">&lt;...&gt;</span></code>
 and <code class="inline"><span class="w">Z</span>&lt;&gt;</code>
 codes may occur.  That is,
authors should not use "<code class="inline"><span class="w">L</span>&lt;<span class="w">B</span><span class="q">&lt;Foo::Bar&gt;</span>&gt;</code>
".</p>
<p>Note, however, that formatting codes and Z&lt;&gt;'s can occur in any
and all parts of an L&lt;...&gt; (i.e., in <i>name</i>, <i>section</i>, <i>text</i>,
and <i>url</i>).</p>
<p>Authors must not nest L&lt;...&gt; codes.  For example, "L&lt;The
L&lt;Foo::Bar&gt; man page&gt;" should be treated as an error.</p>
</li>
<li>
<p>Note that Pod authors may use formatting codes inside the "text"
part of "L&lt;text|name&gt;" (and so on for L&lt;text|/"sec"&gt;).</p>
<p>In other words, this is valid:</p>
<pre class="verbatim"><ol><li>  Go read L&lt;the docs on C&lt;$.&gt;|perlvar/"$."&gt;</li></ol></pre><p>Some output formats that do allow rendering "L&lt;...&gt;" codes as
hypertext, might not allow the link-text to be formatted; in
that case, formatters will have to just ignore that formatting.</p>
</li>
<li>
<p>At time of writing, <code class="inline"><span class="w">L</span><span class="q">&lt;name&gt;</span></code>
 values are of two types:
either the name of a Pod page like <code class="inline"><span class="w">L</span><span class="q">&lt;Foo::Bar&gt;</span></code>
 (which
might be a real Perl module or program in an @INC / PATH
directory, or a .pod file in those places); or the name of a Unix
man page, like <code class="inline"><span class="w">L</span><span class="q">&lt;crontab(5)&gt;</span></code>
.  In theory, <code class="inline"><span class="w">L</span><span class="q">&lt;chmod&gt;</span></code>

is ambiguous between a Pod page called "chmod", or the Unix man page
"chmod" (in whatever man-section).  However, the presence of a string
in parens, as in "crontab(5)", is sufficient to signal that what
is being discussed is not a Pod page, and so is presumably a
Unix man page.  The distinction is of no importance to many
Pod processors, but some processors that render to hypertext formats
may need to distinguish them in order to know how to render a
given <code class="inline"><span class="w">L</span><span class="q">&lt;foo&gt;</span></code>
 code.</p>
</li>
<li>
<p>Previous versions of perlpod allowed for a <code class="inline"><span class="w">L</span><span class="q">&lt;section&gt;</span></code>
 syntax (as in
<code class="inline"><span class="w">L</span><span class="q">&lt;Object Attributes&gt;</span></code>
), which was not easily distinguishable from
<code class="inline"><span class="w">L</span><span class="q">&lt;name&gt;</span></code>
 syntax and for <code class="inline"><span class="w">L</span><span class="q">&lt;&quot;section&quot;&gt;</span></code>
 which was only
slightly less ambiguous.  This syntax is no longer in the specification, and
has been replaced by the <code class="inline"><span class="w">L</span><span class="q">&lt;/section&gt;</span></code>
 syntax (where the slash was
formerly optional).  Pod parsers should tolerate the <code class="inline"><span class="w">L</span><span class="q">&lt;&quot;section&quot;&gt;</span></code>

syntax, for a while at least.  The suggested heuristic for distinguishing
<code class="inline"><span class="w">L</span><span class="q">&lt;section&gt;</span></code>
 from <code class="inline"><span class="w">L</span><span class="q">&lt;name&gt;</span></code>
 is that if it contains any
whitespace, it's a <i>section</i>.  Pod processors should warn about this being
deprecated syntax.</p>
</li>
</ul>
<a name="About-%3dover...%3dback-Regions"></a><h1>About =over...=back Regions</h1>
<p>"=over"..."=back" regions are used for various kinds of list-like
structures.  (I use the term "region" here simply as a collective
term for everything from the "=over" to the matching "=back".)</p>
<ul>
<li>
<p>The non-zero numeric <i>indentlevel</i> in "=over <i>indentlevel</i>" ...
"=back" is used for giving the formatter a clue as to how many
"spaces" (ems, or roughly equivalent units) it should tab over,
although many formatters will have to convert this to an absolute
measurement that may not exactly match with the size of spaces (or M's)
in the document's base font.  Other formatters may have to completely
ignore the number.  The lack of any explicit <i>indentlevel</i> parameter is
equivalent to an <i>indentlevel</i> value of 4.  Pod processors may
complain if <i>indentlevel</i> is present but is not a positive number
matching <code class="inline"><a class="l_k" href="functions/m.html">m/\A(\d*\.)?\d+\z/</a></code>.</p>
</li>
<li>
<p>Authors of Pod formatters are reminded that "=over" ... "=back" may
map to several different constructs in your output format.  For
example, in converting Pod to (X)HTML, it can map to any of
&lt;ul&gt;...&lt;/ul&gt;, &lt;ol&gt;...&lt;/ol&gt;, &lt;dl&gt;...&lt;/dl&gt;, or
&lt;blockquote&gt;...&lt;/blockquote&gt;.  Similarly, "=item" can map to &lt;li&gt; or
&lt;dt&gt;.</p>
</li>
<li>
<p>Each "=over" ... "=back" region should be one of the following:</p>
<ul>
<li>
<p>An "=over" ... "=back" region containing only "=item *" commands,
each followed by some number of ordinary/verbatim paragraphs, other
nested "=over" ... "=back" regions, "=for..." paragraphs, and
"=begin"..."=end" regions.</p>
<p>(Pod processors must tolerate a bare "=item" as if it were "=item
*".)  Whether "*" is rendered as a literal asterisk, an "o", or as
some kind of real bullet character, is left up to the Pod formatter,
and may depend on the level of nesting.</p>
</li>
<li>
<p>An "=over" ... "=back" region containing only
<code class="inline"><a class="l_k" href="functions/m.html">m/\A=item\s+\d+\.?\s*\z/</a></code> paragraphs, each one (or each group of them)
followed by some number of ordinary/verbatim paragraphs, other nested
"=over" ... "=back" regions, "=for..." paragraphs, and/or
"=begin"..."=end" codes.  Note that the numbers must start at 1
in each section, and must proceed in order and without skipping
numbers.</p>
<p>(Pod processors must tolerate lines like "=item 1" as if they were
"=item 1.", with the period.)</p>
</li>
<li>
<p>An "=over" ... "=back" region containing only "=item [text]"
commands, each one (or each group of them) followed by some number of
ordinary/verbatim paragraphs, other nested "=over" ... "=back"
regions, or "=for..." paragraphs, and "=begin"..."=end" regions.</p>
<p>The "=item [text]" paragraph should not match
<code class="inline"><a class="l_k" href="functions/m.html">m/\A=item\s+\d+\.?\s*\z/</a></code> or <code class="inline"><a class="l_k" href="functions/m.html">m/\A=item\s+\*\s*\z/</a></code>, nor should it
match just <code class="inline"><a class="l_k" href="functions/m.html">m/\A=item\s*\z/</a></code>.</p>
</li>
<li>
<p>An "=over" ... "=back" region containing no "=item" paragraphs at
all, and containing only some number of 
ordinary/verbatim paragraphs, and possibly also some nested "=over"
... "=back" regions, "=for..." paragraphs, and "=begin"..."=end"
regions.  Such an itemless "=over" ... "=back" region in Pod is
equivalent in meaning to a "&lt;blockquote&gt;...&lt;/blockquote&gt;" element in
HTML.</p>
</li>
</ul>
<p>Note that with all the above cases, you can determine which type of
"=over" ... "=back" you have, by examining the first (non-"=cut", 
non-"=pod") Pod paragraph after the "=over" command.</p>
</li>
<li>
<p>Pod formatters <i>must</i> tolerate arbitrarily large amounts of text
in the "=item <i>text...</i>" paragraph.  In practice, most such
paragraphs are short, as in:</p>
<pre class="verbatim"><ol><li>  =<span class="w">item</span> <span class="w">For</span> <span class="w">cutting</span> <span class="w">off</span> <a class="l_k" href="functions/our.html">our</a> <span class="w">trade</span> <span class="w">with</span> <span class="w">all</span> <span class="w">parts</span> <span class="w">of</span> <span class="w">the</span> <span class="w">world</span></li></ol></pre><p>But they may be arbitrarily long:</p>
<pre class="verbatim"><ol><li>  =item For transporting us beyond seas to be tried for pretended</li><li>  offenses</li><li></li><li>  =item He is at this time transporting large armies of foreign</li><li>  mercenaries to complete the works of death, desolation and</li><li>  tyranny, already begun with circumstances of cruelty and perfidy</li><li>  scarcely paralleled in the most barbarous ages, and totally</li><li>  unworthy the head of a civilized nation.</li></ol></pre></li>
<li>
<p>Pod processors should tolerate "=item *" / "=item <i>number</i>" commands
with no accompanying paragraph.  The middle item is an example:</p>
<pre class="verbatim"><ol><li>  =over</li><li></li><li>  =item 1</li><li></li><li>  Pick up dry cleaning.</li><li></li><li>  =item 2</li><li></li><li>  =item 3</li><li></li><li>  Stop by the store.  Get Abba Zabas, Stoli, and cheap lawn chairs.</li><li></li><li>  =back</li></ol></pre></li>
<li>
<p>No "=over" ... "=back" region can contain headings.  Processors may
treat such a heading as an error.</p>
</li>
<li>
<p>Note that an "=over" ... "=back" region should have some
content.  That is, authors should not have an empty region like this:</p>
<pre class="verbatim"><ol><li>  =<span class="w">over</span></li><li></li><li>  =<span class="w">back</span></li></ol></pre><p>Pod processors seeing such a contentless "=over" ... "=back" region,
may ignore it, or may report it as an error.</p>
</li>
<li>
<p>Processors must tolerate an "=over" list that goes off the end of the
document (i.e., which has no matching "=back"), but they may warn
about such a list.</p>
</li>
<li>
<p>Authors of Pod formatters should note that this construct:</p>
<pre class="verbatim"><ol><li>  =<span class="w">item</span> <span class="w">Neque</span></li><li></li><li>  =<span class="w">item</span> <span class="w">Porro</span></li><li></li><li>  =<span class="w">item</span> <span class="w">Quisquam</span> <span class="w">Est</span></li><li></li><li>  <span class="w">Qui</span> <span class="w">dolorem</span> <span class="w">ipsum</span> <span class="w">quia</span> <span class="w">dolor</span> <span class="w">sit</span> <span class="w">amet</span><span class="cm">,</span> <span class="w">consectetur</span><span class="cm">,</span> <span class="w">adipisci</span> </li><li>  <span class="w">velit</span><span class="cm">,</span> <span class="w">sed</span> <span class="w">quia</span> <span class="w">non</span> <span class="w">numquam</span> <span class="w">eius</span> <span class="w">modi</span> <span class="w">tempora</span> <span class="w">incidunt</span> <span class="w">ut</span></li><li>  <span class="w">labore</span> <span class="w">et</span> <span class="w">dolore</span> <span class="w">magnam</span> <span class="w">aliquam</span> <span class="w">quaerat</span> <span class="w">voluptatem</span>.</li><li></li><li>  =<span class="w">item</span> <span class="w">Ut</span> <span class="w">Enim</span></li></ol></pre><p>is semantically ambiguous, in a way that makes formatting decisions
a bit difficult.  On the one hand, it could be mention of an item
"Neque", mention of another item "Porro", and mention of another
item "Quisquam Est", with just the last one requiring the explanatory
paragraph "Qui dolorem ipsum quia dolor..."; and then an item
"Ut Enim".  In that case, you'd want to format it like so:</p>
<pre class="verbatim"><ol><li>  <span class="w">Neque</span></li><li></li><li>  <span class="w">Porro</span></li><li></li><li>  <span class="w">Quisquam</span> <span class="w">Est</span></li><li>    <span class="w">Qui</span> <span class="w">dolorem</span> <span class="w">ipsum</span> <span class="w">quia</span> <span class="w">dolor</span> <span class="w">sit</span> <span class="w">amet</span><span class="cm">,</span> <span class="w">consectetur</span><span class="cm">,</span> <span class="w">adipisci</span></li><li>    <span class="w">velit</span><span class="cm">,</span> <span class="w">sed</span> <span class="w">quia</span> <span class="w">non</span> <span class="w">numquam</span> <span class="w">eius</span> <span class="w">modi</span> <span class="w">tempora</span> <span class="w">incidunt</span> <span class="w">ut</span></li><li>    <span class="w">labore</span> <span class="w">et</span> <span class="w">dolore</span> <span class="w">magnam</span> <span class="w">aliquam</span> <span class="w">quaerat</span> <span class="w">voluptatem</span>.</li><li></li><li>  <span class="w">Ut</span> <span class="w">Enim</span></li></ol></pre><p>But it could equally well be a discussion of three (related or equivalent)
items, "Neque", "Porro", and "Quisquam Est", followed by a paragraph
explaining them all, and then a new item "Ut Enim".  In that case, you'd
probably want to format it like so:</p>
<pre class="verbatim"><ol><li>  <span class="w">Neque</span></li><li>  <span class="w">Porro</span></li><li>  <span class="w">Quisquam</span> <span class="w">Est</span></li><li>    <span class="w">Qui</span> <span class="w">dolorem</span> <span class="w">ipsum</span> <span class="w">quia</span> <span class="w">dolor</span> <span class="w">sit</span> <span class="w">amet</span><span class="cm">,</span> <span class="w">consectetur</span><span class="cm">,</span> <span class="w">adipisci</span></li><li>    <span class="w">velit</span><span class="cm">,</span> <span class="w">sed</span> <span class="w">quia</span> <span class="w">non</span> <span class="w">numquam</span> <span class="w">eius</span> <span class="w">modi</span> <span class="w">tempora</span> <span class="w">incidunt</span> <span class="w">ut</span></li><li>    <span class="w">labore</span> <span class="w">et</span> <span class="w">dolore</span> <span class="w">magnam</span> <span class="w">aliquam</span> <span class="w">quaerat</span> <span class="w">voluptatem</span>.</li><li></li><li>  <span class="w">Ut</span> <span class="w">Enim</span></li></ol></pre><p>But (for the foreseeable future), Pod does not provide any way for Pod
authors to distinguish which grouping is meant by the above
"=item"-cluster structure.  So formatters should format it like so:</p>
<pre class="verbatim"><ol><li>  <span class="w">Neque</span></li><li></li><li>  <span class="w">Porro</span></li><li></li><li>  <span class="w">Quisquam</span> <span class="w">Est</span></li><li></li><li>    <span class="w">Qui</span> <span class="w">dolorem</span> <span class="w">ipsum</span> <span class="w">quia</span> <span class="w">dolor</span> <span class="w">sit</span> <span class="w">amet</span><span class="cm">,</span> <span class="w">consectetur</span><span class="cm">,</span> <span class="w">adipisci</span></li><li>    <span class="w">velit</span><span class="cm">,</span> <span class="w">sed</span> <span class="w">quia</span> <span class="w">non</span> <span class="w">numquam</span> <span class="w">eius</span> <span class="w">modi</span> <span class="w">tempora</span> <span class="w">incidunt</span> <span class="w">ut</span></li><li>    <span class="w">labore</span> <span class="w">et</span> <span class="w">dolore</span> <span class="w">magnam</span> <span class="w">aliquam</span> <span class="w">quaerat</span> <span class="w">voluptatem</span>.</li><li></li><li>  <span class="w">Ut</span> <span class="w">Enim</span></li></ol></pre><p>That is, there should be (at least roughly) equal spacing between
items as between paragraphs (although that spacing may well be less
than the full height of a line of text).  This leaves it to the reader
to use (con)textual cues to figure out whether the "Qui dolorem
ipsum..." paragraph applies to the "Quisquam Est" item or to all three
items "Neque", "Porro", and "Quisquam Est".  While not an ideal
situation, this is preferable to providing formatting cues that may
be actually contrary to the author's intent.</p>
</li>
</ul>
<a name="About-Data-Paragraphs-and-%22%3dbegin%2f%3dend%22-Regions"></a><h1>About Data Paragraphs and "=begin/=end" Regions</h1>
<p>Data paragraphs are typically used for inlining non-Pod data that is
to be used (typically passed through) when rendering the document to
a specific format:</p>
<pre class="verbatim"><ol><li>  =begin rtf</li><li></li><li>  \par{\pard\qr\sa4500{\i Printed\~\chdate\~\chtime}\par}</li><li></li><li>  =end rtf</li></ol></pre><p>The exact same effect could, incidentally, be achieved with a single
"=for" paragraph:</p>
<pre class="verbatim"><ol><li>  =for rtf \par{\pard\qr\sa4500{\i Printed\~\chdate\~\chtime}\par}</li></ol></pre><p>(Although that is not formally a data paragraph, it has the same
meaning as one, and Pod parsers may parse it as one.)</p>
<p>Another example of a data paragraph:</p>
<pre class="verbatim"><ol><li>  =begin html</li><li></li><li>  I like &lt;em&gt;PIE&lt;/em&gt;!</li><li></li><li>  &lt;hr&gt;Especially pecan pie!</li><li></li><li>  =end html</li></ol></pre><p>If these were ordinary paragraphs, the Pod parser would try to
expand the "E&lt;/em&gt;" (in the first paragraph) as a formatting
code, just like "E&lt;lt&gt;" or "E&lt;eacute&gt;".  But since this
is in a "=begin <i>identifier</i>"..."=end <i>identifier</i>" region <i>and</i>
the identifier "html" doesn't begin have a ":" prefix, the contents
of this region are stored as data paragraphs, instead of being
processed as ordinary paragraphs (or if they began with a spaces
and/or tabs, as verbatim paragraphs).</p>
<p>As a further example: At time of writing, no "biblio" identifier is
supported, but suppose some processor were written to recognize it as
a way of (say) denoting a bibliographic reference (necessarily
containing formatting codes in ordinary paragraphs).  The fact that
"biblio" paragraphs were meant for ordinary processing would be
indicated by prefacing each "biblio" identifier with a colon:</p>
<pre class="verbatim"><ol><li>  =begin :biblio</li><li></li><li>  Wirth, Niklaus.  1976.  I&lt;Algorithms + Data Structures =</li><li>  Programs.&gt;  Prentice-Hall, Englewood Cliffs, NJ.</li><li></li><li>  =end :biblio</li></ol></pre><p>This would signal to the parser that paragraphs in this begin...end
region are subject to normal handling as ordinary/verbatim paragraphs
(while still tagged as meant only for processors that understand the
"biblio" identifier).  The same effect could be had with:</p>
<pre class="verbatim"><ol><li>  =for :biblio</li><li>  Wirth, Niklaus.  1976.  I&lt;Algorithms + Data Structures =</li><li>  Programs.&gt;  Prentice-Hall, Englewood Cliffs, NJ.</li></ol></pre><p>The ":" on these identifiers means simply "process this stuff
normally, even though the result will be for some special target".
I suggest that parser APIs report "biblio" as the target identifier,
but also report that it had a ":" prefix.  (And similarly, with the
above "html", report "html" as the target identifier, and note the
<i>lack</i> of a ":" prefix.)</p>
<p>Note that a "=begin <i>identifier</i>"..."=end <i>identifier</i>" region where
<i>identifier</i> begins with a colon, <i>can</i> contain commands.  For example:</p>
<pre class="verbatim"><ol><li>  =begin :biblio</li><li></li><li>  Wirth's classic is available in several editions, including:</li><li></li><li>  =for comment</li><li>   hm, check abebooks.com for how much used copies cost.</li><li></li><li>  =over</li><li></li><li>  =item</li><li></li><li>  Wirth, Niklaus.  1975.  I&lt;Algorithmen und Datenstrukturen.&gt;</li><li>  Teubner, Stuttgart.  [Yes, it's in German.]</li><li></li><li>  =item</li><li></li><li>  Wirth, Niklaus.  1976.  I&lt;Algorithms + Data Structures =</li><li>  Programs.&gt;  Prentice-Hall, Englewood Cliffs, NJ.</li><li></li><li>  =back</li><li></li><li>  =end :biblio</li></ol></pre><p>Note, however, a "=begin <i>identifier</i>"..."=end <i>identifier</i>"
region where <i>identifier</i> does <i>not</i> begin with a colon, should not
directly contain "=head1" ... "=head4" commands, nor "=over", nor "=back",
nor "=item".  For example, this may be considered invalid:</p>
<pre class="verbatim"><ol><li>  =<span class="w">begin</span> <span class="w">somedata</span></li><li></li><li>  <span class="w">This</span> <span class="w">is</span> <span class="w">a</span> <span class="w">data</span> <span class="w">paragraph</span>.</li><li></li><li>  =<span class="w">head1</span> <span class="w">Don&#39;t</span> <a class="l_k" href="functions/do.html">do</a> <span class="w">this</span>!</li><li></li><li>  <span class="w">This</span> <span class="w">is</span> <span class="w">a</span> <span class="w">data</span> <span class="w">paragraph</span> <span class="w">too</span>.</li><li></li><li>  =<span class="w">end</span> <span class="w">somedata</span></li></ol></pre><p>A Pod processor may signal that the above (specifically the "=head1"
paragraph) is an error.  Note, however, that the following should
<i>not</i> be treated as an error:</p>
<pre class="verbatim"><ol><li>  =<span class="w">begin</span> <span class="w">somedata</span></li><li></li><li>  <span class="w">This</span> <span class="w">is</span> <span class="w">a</span> <span class="w">data</span> <span class="w">paragraph</span>.</li><li></li><li>  =<span class="w">cut</span></li><li></li><li>  <span class="c"># Yup, this isn&#39;t Pod anymore.</span></li><li><a name="excl"></a>  sub <span class="m">excl</span> <span class="s">{</span> <span class="s">(</span><a class="l_k" href="functions/rand.html">rand</a><span class="s">(</span><span class="s">)</span> &gt; <span class="n">.5</span><span class="s">)</span> ? <span class="q">&quot;hoo!&quot;</span> <span class="co">:</span> <span class="q">&quot;hah!&quot;</span> <span class="s">}</span></li><li></li><li>  =<span class="w">pod</span></li><li></li><li>  <span class="w">This</span> <span class="w">is</span> <span class="w">a</span> <span class="w">data</span> <span class="w">paragraph</span> <span class="w">too</span>.</li><li></li><li>  =<span class="w">end</span> <span class="w">somedata</span></li></ol></pre><p>And this too is valid:</p>
<pre class="verbatim"><ol><li>  =begin someformat</li><li></li><li>  This is a data paragraph.</li><li></li><li>    And this is a data paragraph.</li><li></li><li>  =begin someotherformat</li><li></li><li>  This is a data paragraph too.</li><li></li><li>    And this is a data paragraph too.</li><li></li><li>  =begin :yetanotherformat</li><li></li><li>  =head2 This is a command paragraph!</li><li></li><li>  This is an ordinary paragraph!</li><li></li><li>    And this is a verbatim paragraph!</li><li></li><li>  =end :yetanotherformat</li><li></li><li>  =end someotherformat</li><li></li><li>  Another data paragraph!</li><li></li><li>  =end someformat</li></ol></pre><p>The contents of the above "=begin :yetanotherformat" ...
"=end :yetanotherformat" region <i>aren't</i> data paragraphs, because
the immediately containing region's identifier (":yetanotherformat")
begins with a colon.  In practice, most regions that contain
data paragraphs will contain <i>only</i> data paragraphs; however, 
the above nesting is syntactically valid as Pod, even if it is
rare.  However, the handlers for some formats, like "html",
will accept only data paragraphs, not nested regions; and they may
complain if they see (targeted for them) nested regions, or commands,
other than "=end", "=pod", and "=cut".</p>
<p>Also consider this valid structure:</p>
<pre class="verbatim"><ol><li>  =begin :biblio</li><li></li><li>  Wirth's classic is available in several editions, including:</li><li></li><li>  =over</li><li></li><li>  =item</li><li></li><li>  Wirth, Niklaus.  1975.  I&lt;Algorithmen und Datenstrukturen.&gt;</li><li>  Teubner, Stuttgart.  [Yes, it's in German.]</li><li></li><li>  =item</li><li></li><li>  Wirth, Niklaus.  1976.  I&lt;Algorithms + Data Structures =</li><li>  Programs.&gt;  Prentice-Hall, Englewood Cliffs, NJ.</li><li></li><li>  =back</li><li></li><li>  Buy buy buy!</li><li></li><li>  =begin html</li><li></li><li>  &lt;img src='wirth_spokesmodeling_book.png'&gt;</li><li></li><li>  &lt;hr&gt;</li><li></li><li>  =end html</li><li></li><li>  Now now now!</li><li></li><li>  =end :biblio</li></ol></pre><p>There, the "=begin html"..."=end html" region is nested inside
the larger "=begin :biblio"..."=end :biblio" region.  Note that the
content of the "=begin html"..."=end html" region is data
paragraph(s), because the immediately containing region's identifier
("html") <i>doesn't</i> begin with a colon.</p>
<p>Pod parsers, when processing a series of data paragraphs one
after another (within a single region), should consider them to
be one large data paragraph that happens to contain blank lines.  So
the content of the above "=begin html"..."=end html" <i>may</i> be stored
as two data paragraphs (one consisting of
"&lt;img src='wirth_spokesmodeling_book.png'&gt;\n"
and another consisting of "&lt;hr&gt;\n"), but <i>should</i> be stored as
a single data paragraph (consisting of 
"&lt;img src='wirth_spokesmodeling_book.png'&gt;\n\n&lt;hr&gt;\n").</p>
<p>Pod processors should tolerate empty
"=begin <i>something</i>"..."=end <i>something</i>" regions,
empty "=begin :<i>something</i>"..."=end :<i>something</i>" regions, and
contentless "=for <i>something</i>" and "=for :<i>something</i>"
paragraphs.  I.e., these should be tolerated:</p>
<pre class="verbatim"><ol><li>  =for html</li><li></li><li>  =begin html</li><li></li><li>  =end html</li><li></li><li>  =begin :biblio</li><li></li><li>  =end :biblio</li></ol></pre><p>Incidentally, note that there's no easy way to express a data
paragraph starting with something that looks like a command.  Consider:</p>
<pre class="verbatim"><ol><li>  =<span class="w">begin</span> <span class="w">stuff</span></li><li></li><li>  =<span class="w">shazbot</span></li><li></li><li>  =<span class="w">end</span> <span class="w">stuff</span></li></ol></pre><p>There, "=shazbot" will be parsed as a Pod command "shazbot", not as a data
paragraph "=shazbot\n".  However, you can express a data paragraph consisting
of "=shazbot\n" using this code:</p>
<pre class="verbatim"><ol><li>  =for <span class="w">stuff</span> =<span class="w">shazbot</span></li></ol></pre><p>The situation where this is necessary, is presumably quite rare.</p>
<p>Note that =end commands must match the currently open =begin command.  That
is, they must properly nest.  For example, this is valid:</p>
<pre class="verbatim"><ol><li>  =<span class="w">begin</span> <span class="w">outer</span></li><li></li><li>  <span class="w">X</span></li><li></li><li>  =<span class="w">begin</span> <span class="w">inner</span></li><li></li><li>  <span class="w">Y</span></li><li></li><li>  =<span class="w">end</span> <span class="w">inner</span></li><li></li><li>  <span class="w">Z</span></li><li></li><li>  =<span class="w">end</span> <span class="w">outer</span></li></ol></pre><p>while this is invalid:</p>
<pre class="verbatim"><ol><li>  =<span class="w">begin</span> <span class="w">outer</span></li><li></li><li>  <span class="w">X</span></li><li></li><li>  =<span class="w">begin</span> <span class="w">inner</span></li><li></li><li>  <span class="w">Y</span></li><li></li><li>  =<span class="w">end</span> <span class="w">outer</span></li><li></li><li>  <span class="w">Z</span></li><li></li><li>  =<span class="w">end</span> <span class="w">inner</span></li></ol></pre><p>This latter is improper because when the "=end outer" command is seen, the
currently open region has the formatname "inner", not "outer".  (It just
happens that "outer" is the format name of a higher-up region.)  This is
an error.  Processors must by default report this as an error, and may halt
processing the document containing that error.  A corollary of this is that
regions cannot "overlap". That is, the latter block above does not represent
a region called "outer" which contains X and Y, overlapping a region called
"inner" which contains Y and Z.  But because it is invalid (as all
apparently overlapping regions would be), it doesn't represent that, or
anything at all.</p>
<p>Similarly, this is invalid:</p>
<pre class="verbatim"><ol><li>  =<span class="w">begin</span> <span class="w">thing</span></li><li></li><li>  =<span class="w">end</span> <span class="w">hting</span></li></ol></pre><p>This is an error because the region is opened by "thing", and the "=end"
tries to close "hting" [sic].</p>
<p>This is also invalid:</p>
<pre class="verbatim"><ol><li>  =<span class="w">begin</span> <span class="w">thing</span></li><li></li><li>  =<span class="w">end</span></li></ol></pre><p>This is invalid because every "=end" command must have a formatname
parameter.</p>
<a name="SEE-ALSO"></a><h1>SEE ALSO</h1>
<p><a href="perlpod.html">perlpod</a>, <a href="perlsyn.html#PODs%3a-Embedded-Documentation">PODs: Embedded Documentation in perlsyn</a>,
<a href="podchecker.html">podchecker</a></p>
<a name="AUTHOR"></a><h1>AUTHOR</h1>
<p>Sean M. Burke</p>




  <div id="page_index" class="hud_container">
    <div id="page_index_header" class="hud_header">
      <div id="page_index_close" class="hud_close"><a href="#" onClick="pageIndex.hide();return false;"></a></div>
      <div id="page_index_title" class="hud_title"><span class="hud_span_top">Page index</span></div>
      <div id="page_index_topright" class="hud_topright"></div>
    </div>
    <div id="page_index_content" class="hud_content">
      <ul><li><a href="#NAME">NAME</a><li><a href="#DESCRIPTION">DESCRIPTION</a><li><a href="#Pod-Definitions">Pod Definitions</a><li><a href="#Pod-Commands">Pod Commands</a><li><a href="#Pod-Formatting-Codes">Pod Formatting Codes</a><li><a href="#Notes-on-Implementing-Pod-Processors">Notes on Implementing Pod Processors</a><li><a href="#About-L%3c...%3e-Codes">About L<...> Codes</a><li><a href="#About-%3dover...%3dback-Regions">About =over...=back Regions</a><li><a href="#About-Data-Paragraphs-and-%22%3dbegin%2f%3dend%22-Regions">About Data Paragraphs and "=begin/=end" Regions</a><li><a href="#SEE-ALSO">SEE ALSO</a><li><a href="#AUTHOR">AUTHOR</a></ul>
    </div>
    <div id="page_index_footer" class="hud_footer">
      <div id="page_index_bottomleft" class="hud_bottomleft"></div>
      <div id="page_index_bottom" class="hud_bottom"><span class="hud_span_bottom"></span></div>
      <div id="page_index_resize" class="hud_resize"></div>
    </div>
  </div>


	    &nbsp;
          </div>
          <div id="content_footer">
          </div>
        </div>
        <div class="clear"></div>
      </div>
      
    <div id="footer">
      <div id="footer_content">
        <div id="footer_strapline">
          perldoc.perl.org - Official documentation for the Perl programming language
        </div>
        <div id="footer_links">
          <div id="address">
            <p class="name">Contact details</p>
            <p class="address">
	      Site maintained by <a href="mailto:jj@jonallen.info">Jon Allen (JJ)</a><br>
	    </p>
            <p class="contact">
              Documentation maintained by the <a href="http://lists.cpan.org/showlist.cgi?name=perl5-porters">Perl 5 Porters</a>
            </p>
          </div>
          <ul class="f1">
            <li>Manual
              <ul class="f2">
                <li><a href="index-overview.html">Overview</a>
                <li><a href="index-tutorials.html">Tutorials</a>
                <li><a href="index-faq.html">FAQs</a>
                <li><a href="index-history.html">Changes</a>
              </ul>
            <li>Reference
              <ul class="f2">
                <li><a href="index-language.html">Language</a>
                <li><a href="index-functions.html">Functions</a>
                <li><a href="perlop.html">Operators</a>
                <li><a href="perlvar.html">Variables</a>
              </ul>
            <li>Modules
              <ul class="f2">
                <li><a href="index-modules-A.html">Modules</a>
                <li><a href="index-pragmas.html">Pragmas</a>
                <li><a href="index-utilities.html">Utilities</a>
              </ul>
            <li>Misc
              <ul class="f2">
                <li><a href="index-licence.html">License</a>
                <li><a href="index-internals.html">Internals</a>
                <li><a href="index-platforms.html">Platforms</a>
              </ul>          </ul>
          <div class="clear"></div>
        </div>
      </div>
      <div id="footer_end">
      </div>
    </div>
      
    </div>
      <script language="JavaScript" type="text/javascript" src="static/exploreperl.js"></script>
      <script language="JavaScript" src="static/combined-20100403.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
  perldoc.setPath(0);
  perldoc.pageName    = 'perlpodspec';
  perldoc.pageAddress = 'perlpodspec.html';
  perldoc.contentPage = 1;
  explorePerl.render();
  explorePerl.addEvents('explore_anchor');
</script>
    
  </body>
</html>