⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perlpodspec.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
📖 第 1 页 / 共 5 页
字号:
.SpConsider:.Sp.Vb 1\&    C<$x ? $y    :  $z>\&\&    S<C<$x ? $y     :  $z>>.Ve.SpBoth signify the monospace (c[ode] style) text consisting of\&\*(L"$x\*(R", one space, \*(L"?\*(R", one space, \*(L":\*(R", one space, \*(L"$z\*(R".  Thedifference is that in the latter, with the S code, those spacesare not \*(L"normal\*(R" spaces, but instead are non-breaking spaces..PPIf a Pod processor sees any formatting code other than the oneslisted above (as in \*(L"N<...>\*(R", or \*(L"Q<...>\*(R", etc.), thatprocessor must by default treat this as an error.A Pod parser may allow a way for particularapplications to add to the above list of known formatting codes;a Pod parser might even allow a way to stipulate, for each additionalcommand, whether it requires some form of special processing, asL<...> does..PPFuture versions of this specification may add additionalformatting codes..PPHistorical note:  A few older Pod processors would not see a \*(L">\*(R" asclosing a \*(L"C<\*(R" code, if the \*(L">\*(R" was immediately preceded bya \*(L"\-\*(R".  This was so that this:.PP.Vb 1\&    C<$foo\->bar>.Ve.PPwould parse as equivalent to this:.PP.Vb 1\&    C<$foo\-E<gt>bar>.Ve.PPinstead of as equivalent to a \*(L"C\*(R" formatting code containing only \*(L"$foo\-\*(R", and then a \*(L"bar>\*(R" outside the \*(L"C\*(R" formatting code.  Thisproblem has since been solved by the addition of syntaxes like this:.PP.Vb 1\&    C<< $foo\->bar >>.Ve.PPCompliant parsers must not treat \*(L"\->\*(R" as special..PPFormatting codes absolutely cannot span paragraphs.  If a code isopened in one paragraph, and no closing code is found by the end ofthat paragraph, the Pod parser must close that formatting code,and should complain (as in \*(L"Unterminated I code in the paragraphstarting at line 123: 'Time objects are not...'\*(R").  So thesetwo paragraphs:.PP.Vb 1\&  I<I told you not to do this!\&\&  Don\*(Aqt make me say it again!>.Ve.PP\&...must \fInot\fR be parsed as two paragraphs in italics (with the Icode starting in one paragraph and starting in another.)  Instead,the first paragraph should generate a warning, but that aside, theabove code must parse as if it were:.PP.Vb 1\&  I<I told you not to do this!>\&\&  Don\*(Aqt make me say it again!E<gt>.Ve.PP(In SGMLish jargon, all Pod commands are like block-levelelements, whereas all Pod formatting codes are like inline-levelelements.).SH "Notes on Implementing Pod Processors".IX Header "Notes on Implementing Pod Processors"The following is a long section of miscellaneous requirementsand suggestions to do with Pod processing..IP "\(bu" 4Pod formatters should tolerate lines in verbatim blocks that are ofany length, even if that means having to break them (possibly severaltimes, for very long lines) to avoid text running off the side of thepage.  Pod formatters may warn of such line-breaking.  Such warningsare particularly appropriate for lines are over 100 characters long, whichare usually not intentional..IP "\(bu" 4Pod parsers must recognize \fIall\fR of the three well-known newlineformats: \s-1CR\s0, \s-1LF\s0, and \s-1CRLF\s0.  See perlport..IP "\(bu" 4Pod parsers should accept input lines that are of any length..IP "\(bu" 4Since Perl recognizes a Unicode Byte Order Mark at the start of filesas signaling that the file is Unicode encoded as in \s-1UTF\-16\s0 (whetherbig-endian or little-endian) or \s-1UTF\-8\s0, Pod parsers should do thesame.  Otherwise, the character encoding should be understood asbeing \s-1UTF\-8\s0 if the first highbit byte sequence in the file seemsvalid as a \s-1UTF\-8\s0 sequence, or otherwise as Latin\-1..SpFuture versions of this specification may specifyhow Pod can accept other encodings.  Presumably treatment of otherencodings in Pod parsing would be as in \s-1XML\s0 parsing: whatever theencoding declared by a particular Pod file, content is to bestored in memory as Unicode characters..IP "\(bu" 4The well known Unicode Byte Order Marks are as follows:  if thefile begins with the two literal byte values 0xFE 0xFF, this isthe \s-1BOM\s0 for big-endian \s-1UTF\-16\s0.  If the file begins with the twoliteral byte value 0xFF 0xFE, this is the \s-1BOM\s0 for little-endian\&\s-1UTF\-16\s0.  If the file begins with the three literal byte values0xEF 0xBB 0xBF, this is the \s-1BOM\s0 for \s-1UTF\-8\s0..IP "\(bu" 4A naive but sufficient heuristic for testing the first highbitbyte-sequence in a BOM-less file (whether in code or in Pod!), to seewhether that sequence is valid as \s-1UTF\-8\s0 (\s-1RFC\s0 2279) is to check whetherthat the first byte in the sequence is in the range 0xC0 \- 0xFD\&\fIand\fR whether the next byte is in the range0x80 \- 0xBF.  If so, the parser may conclude that this file is in\&\s-1UTF\-8\s0, and all highbit sequences in the file should be assumed tobe \s-1UTF\-8\s0.  Otherwise the parser should treat the file as beingin Latin\-1.  In the unlikely circumstance that the first highbitsequence in a truly non\-UTF\-8 file happens to appear to be \s-1UTF\-8\s0, onecan cater to our heuristic (as well as any more intelligent heuristic)by prefacing that line with a comment line containing a highbitsequence that is clearly \fInot\fR valid as \s-1UTF\-8\s0.  A line consistingof simply \*(L"#\*(R", an e\-acute, and any non-highbit byte,is sufficient to establish this file's encoding..IP "\(bu" 4This document's requirements and suggestions about encodingsdo not apply to Pod processors running on non-ASCII platforms,notably \s-1EBCDIC\s0 platforms..IP "\(bu" 4Pod processors must treat a \*(L"=for [label] [content...]\*(R" paragraph asmeaning the same thing as a \*(L"=begin [label]\*(R" paragraph, content, andan \*(L"=end [label]\*(R" paragraph.  (The parser may conflate these twoconstructs, or may leave them distinct, in the expectation that theformatter will nevertheless treat them the same.).IP "\(bu" 4When rendering Pod to a format that allows comments (i.e., to nearlyany format other than plaintext), a Pod formatter must insert commenttext identifying its name and version number, and the name andversion numbers of any modules it might be using to process the Pod.Minimal examples:.Sp.Vb 1\&  %% POD::Pod2PS v3.14159, using POD::Parser v1.92\&\&  <!\-\- Pod::HTML v3.14159, using POD::Parser v1.92 \-\->\&\&  {\edoccomm generated by Pod::Tree::RTF 3.14159 using Pod::Tree 1.08}\&\&  .\e" Pod::Man version 3.14159, using POD::Parser version 1.92.Ve.SpFormatters may also insert additional comments, including: therelease date of the Pod formatter program, the contact address forthe author(s) of the formatter, the current time, the name of inputfile, the formatting options in effect, version of Perl used, etc..SpFormatters may also choose to note errors/warnings as comments,besides or instead of emitting them otherwise (as in messages to\&\s-1STDERR\s0, or \f(CW\*(C`die\*(C'\fRing)..IP "\(bu" 4Pod parsers \fImay\fR emit warnings or error messages (\*(L"Unknown E codeE<zslig>!\*(R") to \s-1STDERR\s0 (whether through printing to \s-1STDERR\s0, or\&\f(CW\*(C`warn\*(C'\fRing/\f(CW\*(C`carp\*(C'\fRing, or \f(CW\*(C`die\*(C'\fRing/\f(CW\*(C`croak\*(C'\fRing), but \fImust\fR allowsuppressing all such \s-1STDERR\s0 output, and instead allow an option forreporting errors/warningsin some other way, whether by triggering a callback, or noting errorsin some attribute of the document object, or some similarly unobtrusivemechanism \*(-- or even by appending a \*(L"Pod Errors\*(R" section to the end ofthe parsed form of the document..IP "\(bu" 4In cases of exceptionally aberrant documents, Pod parsers may abort theparse.  Even then, using \f(CW\*(C`die\*(C'\fRing/\f(CW\*(C`croak\*(C'\fRing is to be avoided; wherepossible, the parser library may simply close the input fileand add text like \*(L"*** Formatting Aborted ***\*(R" to the end of the(partial) in-memory document..IP "\(bu" 4In paragraphs where formatting codes (like E<...>, B<...>)are understood (i.e., \fInot\fR verbatim paragraphs, but \fIincluding\fRordinary paragraphs, and command paragraphs that produce renderabletext, like \*(L"=head1\*(R"), literal whitespace should generally be considered\&\*(L"insignificant\*(R", 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 terminatethe paragraph).  Pod parsers should compact literal whitespace in eachprocessed paragraph, but may provide an option for overriding this(since some processing tasks do not require it), or may followadditional special rules (for example, specially treatingperiod-space-space or period-newline sequences)..IP "\(bu" 4Pod parsers should not, by default, try to coerce apostrophe (') andquote (\*(L") into smart quotes (little 9's, 66's, 99's, etc), nor try toturn backtick (`) into anything else but a single backtick character(distinct from an open quote character!), nor \*(R"\-\-" into anything buttwo minus signs.  They \fImust never\fR do any of those things to textin C<...> formatting codes, and never \fIever\fR to text in verbatimparagraphs..IP "\(bu" 4When rendering Pod to a format that has two kinds of hyphens (\-), onethat's a non-breaking hyphen, and another that's a breakable hyphen(as in \*(L"object-oriented\*(R", which can be split across lines as\&\*(L"object\-\*(R", newline, \*(L"oriented\*(R"), formatters are encouraged togenerally translate \*(L"\-\*(R" to non-breaking hyphen, but may applyheuristics to convert some of these to breaking hyphens..IP "\(bu" 4Pod formatters should make reasonable efforts to keep words of Perlcode from being broken across lines.  For example, \*(L"Foo::Bar\*(R" in someformatting systems is seen as eligible for being broken across linesas \*(L"Foo::\*(R" newline \*(L"Bar\*(R" or even \*(L"Foo::\-\*(R" newline \*(L"Bar\*(R".  This shouldbe avoided where possible, either by disabling all line-breaking inmid-word, or by wrapping particular words with internal punctuationin \*(L"don't break this across lines\*(R" codes (which in some formats maynot be a single code, but might be a matter of inserting non-breakingzero-width spaces between every pair of characters in a word.).IP "\(bu" 4Pod parsers should, by default, expand tabs in verbatim paragraphs asthey are processed, before passing them to the formatter or otherprocessor.  Parsers may also allow an option for overriding this..IP "\(bu" 4Pod parsers should, by default, remove newlines from the end ofordinary and verbatim paragraphs before passing them to theformatter.  For example, while the paragraph you're reading nowcould 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..IP "\(bu" 4Pod parsers, when reporting errors, should make some effort to reportan approximate line number (\*(L"Nested E<>'s in Paragraph #52, nearline 633 of Thing/Foo.pm!\*(R"), instead of merely noting the paragraphnumber (\*(L"Nested E<>'s in Paragraph #52 of Thing/Foo.pm!\*(R").  Wherethis is problematic, the paragraph number should at least beaccompanied by an excerpt from the paragraph (\*(L"Nested E<>'s inParagraph #52 of Thing/Foo.pm, which begins 'Read/write accessor forthe C<interest rate> attribute...'\*(R")..IP "\(bu" 4Pod parsers, when processing a series of verbatim paragraphs oneafter another, should consider them to be one large verbatimparagraph that happens to contain blank lines.  I.e., these twolines, which have a blank line between them:.Sp.Vb 1\&        use Foo;\&\&        print Foo\->VERSION.Ve.Spshould be unified into one paragraph (\*(L"\etuse Foo;\en\en\etprintFoo\->\s-1VERSION\s0\*(R") before being passed to the formatter or otherprocessor.  Parsers may also allow an option for overriding this..SpWhile this might be too cumbersome to implement in event-based Podparsers, it is straightforward for parsers that return parse trees..IP "\(bu" 4Pod formatters, where feasible, are advised to avoid splitting shortverbatim paragraphs (under twelve lines, say) across pages..IP "\(bu" 4Pod parsers must treat a line with only spaces and/or tabs on it as a\&\*(L"blank line\*(R" such as separates paragraphs.  (Some older parsersrecognized only two adjacent newlines as a \*(L"blank line\*(R" but would notrecognize a newline, a space, and a newline, as a blank line.  Thisis noncompliant behavior.).IP "\(bu" 4Authors of Pod formatters/processors should make every effort toavoid writing their own Pod parser.  There are already several in\&\s-1CPAN\s0, with a wide range of interface styles \*(-- and one of them,Pod::Parser, comes with modern versions of Perl..IP "\(bu" 4Characters in Pod documents may be conveyed either as literals, or bynumber in E<n> codes, or by an equivalent mnemonic, as inE<eacute> which is exactly equivalent to E<233>..SpCharacters in the range 32\-126 refer to those well known US-ASCIIcharacters (also defined there by Unicode, with the same meaning),which all Pod formatters must render faithfully.  Charactersin the ranges 0\-31 and 127\-159 should not be used (neither asliterals, nor as E<number> codes), except for theliteral byte-sequences for newline (13, 13 10, or 10), and tab (9)..SpCharacters in the range 160\-255 refer to Latin\-1 characters (alsodefined there by Unicode, with the same meaning).  Characters above255 should be understood to refer to Unicode characters..IP "\(bu" 4Be warnedthat some formatters cannot reliably render characters outside 32\-126;and many are able to handle 32\-126 and 160\-255, but nothing above255..IP "\(bu" 4Besides the well-known \*(L"E<lt>\*(R" and \*(L"E<gt>\*(R" codes forless-than and greater-than, Pod parsers must understand \*(L"E<sol>\*(R"for \*(L"/\*(R" (solidus, slash), and \*(L"E<verbar>\*(R" for \*(L"|\*(R" (vertical bar,pipe).  Pod parsers should also understand \*(L"E<lchevron>\*(R" and\&\*(L"E<rchevron>\*(R" as legacy codes for characters 171 and 187, i.e.,\&\*(L"left-pointing double angle quotation mark\*(R" = \*(L"left pointingguillemet\*(R" and \*(L"right-pointing double angle quotation mark\*(R" = \*(L"right

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -