📄 perlpod.1
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. \*(C+ will.\" give a nicer C++. Capital omega is used to do unbreakable dashes and.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "PERLPOD 1".TH PERLPOD 1 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"perlpod \- the Plain Old Documentation format.IX Xref "POD plain old documentation".SH "DESCRIPTION".IX Header "DESCRIPTION"Pod is a simple-to-use markup language used for writing documentationfor Perl, Perl programs, and Perl modules..PPTranslators are available for converting Pod to various formatslike plain text, \s-1HTML\s0, man pages, and more..PPPod markup consists of three basic kinds of paragraphs:ordinary,verbatim, and command..Sh "Ordinary Paragraph".IX Xref "POD, ordinary paragraph".IX Subsection "Ordinary Paragraph"Most paragraphs in your documentation will be ordinary blocksof text, like this one. You can simply type in your text withoutany markup whatsoever, and with just a blank line before andafter. When it gets formatted, it will undergo minimal formatting, like being rewrapped, probably put into a proportionally spacedfont, and maybe even justified..PPYou can use formatting codes in ordinary paragraphs, for \fBbold\fR,\&\fIitalic\fR, \f(CW\*(C`code\-style\*(C'\fR, hyperlinks, and more. Suchcodes are explained in the "Formatting Codes"section, below..Sh "Verbatim Paragraph".IX Xref "POD, verbatim paragraph verbatim".IX Subsection "Verbatim Paragraph"Verbatim paragraphs are usually used for presenting a codeblock orother text which does not require any special parsing or formatting,and which shouldn't be wrapped..PPA verbatim paragraph is distinguished by having its first characterbe a space or a tab. (And commonly, all its lines begin with spacesand/or tabs.) It should be reproduced exactly, with tabs assumed tobe on 8\-column boundaries. There are no special formatting codes,so you can't italicize or anything like that. A \e means \e, andnothing else..Sh "Command Paragraph".IX Xref "POD, command".IX Subsection "Command Paragraph"A command paragraph is used for special treatment of whole chunksof text, usually as headings or parts of lists..PPAll command paragraphs (which are typically only one line long) startwith \*(L"=\*(R", followed by an identifier, followed by arbitrary text thatthe command can use however it pleases. Currently recognized commandsare.PP.Vb 10\& =pod\& =head1 Heading Text\& =head2 Heading Text\& =head3 Heading Text\& =head4 Heading Text\& =over indentlevel\& =item stuff\& =back\& =begin format\& =end format\& =for format text...\& =encoding type\& =cut.Ve.PPTo explain them each in detail:.ie n .IP """=head1 \f(CIHeading Text\f(CW""" 4.el .IP "\f(CW=head1 \f(CIHeading Text\f(CW\fR" 4.IX Xref "=head1 =head2 =head3 =head4 head1 head2 head3 head4".IX Item "=head1 Heading Text".PD 0.ie n .IP """=head2 \f(CIHeading Text\f(CW""" 4.el .IP "\f(CW=head2 \f(CIHeading Text\f(CW\fR" 4.IX Item "=head2 Heading Text".ie n .IP """=head3 \f(CIHeading Text\f(CW""" 4.el .IP "\f(CW=head3 \f(CIHeading Text\f(CW\fR" 4.IX Item "=head3 Heading Text".ie n .IP """=head4 \f(CIHeading Text\f(CW""" 4.el .IP "\f(CW=head4 \f(CIHeading Text\f(CW\fR" 4.IX Item "=head4 Heading Text".PDHead1 through head4 produce headings, head1 being the highestlevel. The text in the rest of this paragraph is the content of theheading. For example:.Sp.Vb 1\& =head2 Object Attributes.Ve.SpThe text \*(L"Object Attributes\*(R" comprises the heading there. (Note thathead3 and head4 are recent additions, not supported in older Podtranslators.) The text in these heading commands can useformatting codes, as seen here:.Sp.Vb 1\& =head2 Possible Values for C<$/>.Ve.SpSuch commands are explained in the"Formatting Codes" section, below..ie n .IP """=over \f(CIindentlevel\f(CW""" 4.el .IP "\f(CW=over \f(CIindentlevel\f(CW\fR" 4.IX Xref "=over =item =back over item back".IX Item "=over indentlevel".PD 0.ie n .IP """=item \f(CIstuff...\f(CW""" 4.el .IP "\f(CW=item \f(CIstuff...\f(CW\fR" 4.IX Item "=item stuff...".ie n .IP """=back""" 4.el .IP "\f(CW=back\fR" 4.IX Item "=back".PDItem, over, and back require a little more explanation: \*(L"=over\*(R" startsa region specifically for the generation of a list using \*(L"=item\*(R"commands, or for indenting (groups of) normal paragraphs. At the endof your list, use \*(L"=back\*(R" to end it. The \fIindentlevel\fR option to\&\*(L"=over\*(R" indicates how far over to indent, generally in ems (whereone em is the width of an \*(L"M\*(R" in the document's base font) or roughlycomparable units; if there is no \fIindentlevel\fR option, it defaultsto four. (And some formatters may just ignore whatever \fIindentlevel\fRyou provide.) In the \fIstuff\fR in \f(CW\*(C`=item \f(CIstuff...\f(CW\*(C'\fR, you mayuse formatting codes, as seen here:.Sp.Vb 1\& =item Using C<$|> to Control Buffering.Ve.SpSuch commands are explained in the"Formatting Codes" section, below..SpNote also that there are some basic rules to using \*(L"=over\*(R" ...\&\*(L"=back\*(R" regions:.RS 4.IP "\(bu" 4Don't use \*(L"=item\*(R"s outside of an \*(L"=over\*(R" ... \*(L"=back\*(R" region..IP "\(bu" 4The first thing after the \*(L"=over\*(R" command should be an \*(L"=item\*(R", unlessthere aren't going to be any items at all in this \*(L"=over\*(R" ... \*(L"=back\*(R"region..IP "\(bu" 4Don't put "=head\fIn\fR\*(L" commands inside an \*(R"=over\*(L" ... \*(R"=back" region..IP "\(bu" 4And perhaps most importantly, keep the items consistent: either use\&\*(L"=item *\*(R" for all of them, to produce bullets; or use \*(L"=item 1.\*(R",\&\*(L"=item 2.\*(R", etc., to produce numbered lists; or use \*(L"=item foo\*(R",\&\*(L"=item bar\*(R", etc. \*(-- namely, things that look nothing like bullets ornumbers..SpIf you start with bullets or numbers, stick with them, asformatters use the first \*(L"=item\*(R" type to decide how to format thelist..RE.RS 4.RE.ie n .IP """=cut""" 4.el .IP "\f(CW=cut\fR" 4.IX Xref "=cut cut".IX Item "=cut"To end a Pod block, use a blank line,then a line beginning with \*(L"=cut\*(R", and a blankline after it. This lets Perl (and the Pod formatter) know thatthis is where Perl code is resuming. (The blank line before the \*(L"=cut\*(R"is not technically necessary, but many older Pod processors require it.).ie n .IP """=pod""" 4.el .IP "\f(CW=pod\fR" 4.IX Xref "=pod pod".IX Item "=pod"The \*(L"=pod\*(R" command by itself doesn't do much of anything, but itsignals to Perl (and Pod formatters) that a Pod block starts here. APod block starts with \fIany\fR command paragraph, so a \*(L"=pod\*(R" command isusually used just when you want to start a Pod block with an ordinaryparagraph or a verbatim paragraph. For example:.Sp.Vb 1\& =item stuff()\&\& This function does stuff.\&\& =cut\&\& sub stuff {\& ...\& }\&\& =pod\&\& Remember to check its return value, as in:\&\& stuff() || die "Couldn\*(Aqt do stuff!";\&\& =cut.Ve.ie n .IP """=begin \f(CIformatname\f(CW""" 4.el .IP "\f(CW=begin \f(CIformatname\f(CW\fR" 4.IX Xref "=begin =end =for begin end for".IX Item "=begin formatname".PD 0.ie n .IP """=end \f(CIformatname\f(CW""" 4.el .IP "\f(CW=end \f(CIformatname\f(CW\fR" 4.IX Item "=end formatname".ie n .IP """=for \f(CIformatname\f(CW \f(CItext...\f(CW""" 4.el .IP "\f(CW=for \f(CIformatname\f(CW \f(CItext...\f(CW\fR" 4.IX Item "=for formatname text...".PDFor, begin, and end will let you have regions of text/code/data thatare not generally interpreted as normal Pod text, but are passeddirectly to particular formatters, or are otherwise special. Aformatter that can use that format will use the region, otherwise itwill be completely ignored..SpA command "=begin \fIformatname\fR\*(L", some paragraphs, and acommand \*(R"=end \fIformatname\fR", mean that the text/data in betweenis meant for formatters that understand the special formatcalled \fIformatname\fR. For example,.Sp.Vb 1\& =begin html\&\& <hr> <img src="thang.png">\& <p> This is a raw HTML paragraph </p>\&\& =end html.Ve.SpThe command "=for \fIformatname\fR \fItext...\fR"specifies that the remainder of just this paragraph (startingright after \fIformatname\fR) is in that special format..Sp.Vb 2\& =for html <hr> <img src="thang.png">\& <p> This is a raw HTML paragraph </p>.Ve.SpThis means the same thing as the above \*(L"=begin html\*(R" ... \*(L"=end html\*(R"region..SpThat is, with \*(L"=for\*(R", you can have only one paragraph's worthof text (i.e., the text in \*(L"=foo targetname text...\*(R"), but with\&\*(L"=begin targetname\*(R" ... \*(L"=end targetname\*(R", you can have any amountof stuff inbetween. (Note that there still must be a blank lineafter the \*(L"=begin\*(R" command and a blank line before the \*(L"=end\*(R"command..SpHere are some examples of how to use these:.Sp.Vb 1\& =begin html\&\& <br>Figure 1.<br><IMG SRC="figure1.png"><br>\&\& =end html\&\& =begin text\&\& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\& | foo |\& | bar |\& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\&\& ^^^^ Figure 1. ^^^^\&\& =end text.Ve.SpSome format names that formatters currently are known to acceptinclude \*(L"roff\*(R", \*(L"man\*(R", \*(L"latex\*(R", \*(L"tex\*(R", \*(L"text\*(R", and \*(L"html\*(R". (Someformatters will treat some of these as synonyms.).SpA format name of \*(L"comment\*(R" is common for just making notes (presumablyto yourself) that won't appear in any formatted version of the Poddocument:.Sp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -