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

📄 yaml.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
.PPThe current options are:.IP "DumperClass" 4.IX Item "DumperClass"You can override which module/class \s-1YAML\s0 uses for Dumping data..IP "LoaderClass" 4.IX Item "LoaderClass"You can override which module/class \s-1YAML\s0 uses for Loading data..IP "Indent" 4.IX Item "Indent"This is the number of space characters to use for each indentation levelwhen doing a \fIDump()\fR. The default is 2..SpBy the way, \s-1YAML\s0 can use any number of characters for indentation at anylevel. So if you are editing \s-1YAML\s0 by hand feel free to do it anyway thatlooks pleasing to you; just be consistent for a given level..IP "SortKeys" 4.IX Item "SortKeys"Default is 1. (true).SpTells \s-1YAML\s0.pm whether or not to sort hash keys when storing a document..SpYAML::Node objects can have their own sort order, which is usually whatyou want. To override the YAML::Node order and sort the keys anyway, setSortKeys to 2..IP "Stringify" 4.IX Item "Stringify"Default is 0. (false).SpObjects with string overloading should honor the overloading and dump thestringification of themselves, rather than the actual object's guts..IP "UseHeader" 4.IX Item "UseHeader"Default is 1. (true).SpThis tells \s-1YAML\s0.pm whether to use a separator string for a Dumpoperation. This only applies to the first document in a stream.Subsequent documents must have a \s-1YAML\s0 header by definition..IP "UseVersion" 4.IX Item "UseVersion"Default is 0. (false).SpTells \s-1YAML\s0.pm whether to include the \s-1YAML\s0 version on theseparator/header..Sp.Vb 1\&    \-\-\- %YAML:1.0.Ve.IP "AnchorPrefix" 4.IX Item "AnchorPrefix"Default is ''..SpAnchor names are normally numeric. \s-1YAML\s0.pm simply starts with '1' andincreases by one for each new anchor. This option allows you to specify astring to be prepended to each anchor number..IP "UseCode" 4.IX Item "UseCode"Setting the UseCode option is a shortcut to set both the DumpCode andLoadCode options at once. Setting UseCode to '1' tells \s-1YAML\s0.pm to dumpPerl code references as Perl (using B::Deparse) and to load them backinto memory using \fIeval()\fR. The reason this has to be an option is thatusing \fIeval()\fR to parse untrusted code is, well, untrustworthy..IP "DumpCode" 4.IX Item "DumpCode"Determines if and how \s-1YAML\s0.pm should serialize Perl code references. Bydefault \s-1YAML\s0.pm will dump code references as dummy placeholders (muchlike Data::Dumper). If DumpCode is set to '1' or 'deparse', codereferences will be dumped as actual Perl code..SpDumpCode can also be set to a subroutine reference so that you canwrite your own serializing routine. \s-1YAML\s0.pm passes you the code ref. Youpass back the serialization (as a string) and a format indicator. Theformat indicator is a simple string like: 'deparse' or 'bytecode'..IP "LoadCode" 4.IX Item "LoadCode"LoadCode is the opposite of DumpCode. It tells \s-1YAML\s0 if and how todeserialize code references. When set to '1' or 'deparse' it will use\&\f(CW\*(C`eval()\*(C'\fR. Since this is potentially risky, only use this option if youknow where your \s-1YAML\s0 has been..SpLoadCode can also be set to a subroutine reference so that you can writeyour own deserializing routine. \s-1YAML\s0.pm passes the serialization (as astring) and a format indicator. You pass back the code reference..IP "UseBlock" 4.IX Item "UseBlock"\&\s-1YAML\s0.pm uses heuristics to guess which scalar style is best for a givennode. Sometimes you'll want all multiline scalars to use the 'block'style. If so, set this option to 1..Sp\&\s-1NOTE:\s0 \s-1YAML\s0's block style is akin to Perl's here-document..IP "UseFold" 4.IX Item "UseFold"If you want to force \s-1YAML\s0 to use the 'folded' style for all multilinescalars, then set \f(CW$UseFold\fR to 1..Sp\&\s-1NOTE:\s0 \s-1YAML\s0's folded style is akin to the way \s-1HTML\s0 folds text,      except smarter..IP "UseAliases" 4.IX Item "UseAliases"\&\s-1YAML\s0 has an alias mechanism such that any given structure in memory getsserialized once. Any other references to that structure are serializedonly as alias markers. This is how \s-1YAML\s0 can serialize duplicate andrecursive structures..SpSometimes, when you \s-1KNOW\s0 that your data is nonrecursive in nature, youmay want to serialize such that every node is expressed in full. (ie asa copy of the original). Setting \f(CW$YAML::UseAliases\fR to 0 will allow youto do this. This also may result in faster processing because the lookupoverhead is by bypassed..Sp\&\s-1THIS\s0 \s-1OPTION\s0 \s-1CAN\s0 \s-1BE\s0 \s-1DANGEROUS\s0. *If* your data is recursive, this option*will* cause \fIDump()\fR to run in an endless loop, chewing up your computersmemory. You have been warned..IP "CompressSeries" 4.IX Item "CompressSeries"Default is 1..SpCompresses the formatting of arrays of hashes:.Sp.Vb 4\&    \-\&      foo: bar\&    \- \&      bar: foo.Ve.Spbecomes:.Sp.Vb 2\&    \- foo: bar\&    \- bar: foo.Ve.SpSince this output is usually more desirable, this option is turned on bydefault..SH "YAML TERMINOLOGY".IX Header "YAML TERMINOLOGY"\&\s-1YAML\s0 is a full featured data serialization language, and thus has itsown terminology..PPIt is important to remember that although \s-1YAML\s0 is heavily influenced byPerl and Python, it is a language in its own right, not merely just arepresentation of Perl structures..PP\&\s-1YAML\s0 has three constructs that are conspicuously similar to Perl's hash,array, and scalar. They are called mapping, sequence, and stringrespectively. By default, they do what you would expect. But eachinstance may have an explicit or implicit tag (type) that makes itbehave differently. In this manner, \s-1YAML\s0 can be extended to representPerl's Glob or Python's tuple, or Ruby's Bigint..IP "stream" 4.IX Item "stream"A \s-1YAML\s0 stream is the full sequence of unicode characters that a \s-1YAML\s0parser would read or a \s-1YAML\s0 emitter would write. A stream may containone or more \s-1YAML\s0 documents separated by \s-1YAML\s0 headers..Sp.Vb 6\&    \-\-\-\&    a: mapping\&    foo: bar\&    \-\-\-\&    \- a\&    \- sequence.Ve.IP "document" 4.IX Item "document"A \s-1YAML\s0 document is an independent data structure representation within astream. It is a top level node. Each document in a \s-1YAML\s0 stream mustbegin with a \s-1YAML\s0 header line. Actually the header is optional on thefirst document..Sp.Vb 6\&    \-\-\-\&    This: top level mapping\&    is:\&        \- a\&        \- YAML\&        \- document.Ve.IP "header" 4.IX Item "header"A \s-1YAML\s0 header is a line that begins a \s-1YAML\s0 document. It consists ofthree dashes, possibly followed by more info. Another purpose of theheader line is that it serves as a place to put top level tag and anchorinformation..Sp.Vb 3\&    \-\-\- !recursive\-sequence &001\&    \- * 001\&    \- * 001.Ve.IP "node" 4.IX Item "node"A \s-1YAML\s0 node is the representation of a particular data stucture. Nodesmay contain other nodes. (In Perl terms, nodes are like scalars.Strings, arrayrefs and hashrefs. But this refers to the serializedformat, not the in-memory structure.).IP "tag" 4.IX Item "tag"This is similar to a type. It indicates how a particular \s-1YAML\s0 nodeserialization should be transferred into or out of memory. For instancea Foo::Bar object would use the tag 'perl/Foo::Bar':.Sp.Vb 3\&    \- !perl/Foo::Bar\&        foo: 42\&        bar: stool.Ve.IP "collection" 4.IX Item "collection"A collection is the generic term for a \s-1YAML\s0 data grouping. \s-1YAML\s0 has twotypes of collections: mappings and sequences. (Similar to hashes and arrays).IP "mapping" 4.IX Item "mapping"A mapping is a \s-1YAML\s0 collection defined by unordered key/value pairs withunique keys. By default \s-1YAML\s0 mappings are loaded into Perl hashes..Sp.Vb 3\&    a mapping:\&        foo: bar\&        two: times two is 4.Ve.IP "sequence" 4.IX Item "sequence"A sequence is a \s-1YAML\s0 collection defined by an ordered list of elements. Bydefault \s-1YAML\s0 sequences are loaded into Perl arrays..Sp.Vb 4\&    a sequence:\&        \- one bourbon\&        \- one scotch\&        \- one beer.Ve.IP "scalar" 4.IX Item "scalar"A scalar is a \s-1YAML\s0 node that is a single value. By default \s-1YAML\s0 scalarsare loaded into Perl scalars..Sp.Vb 1\&    a scalar key: a scalar value.Ve.Sp\&\s-1YAML\s0 has many styles for representing scalars. This is important becausevarying data will have varying formatting requirements to retain theoptimum human readability..IP "plain scalar" 4.IX Item "plain scalar"A plain sclar is unquoted. All plain scalars are automatic candidatesfor \*(L"implicit tagging\*(R". This means that their tag may be determinedautomatically by examination. The typical uses for this are plain alphastrings, integers, real numbers, dates, times and currency..Sp.Vb 5\&    \- a plain string\&    \- \-42\&    \- 3.1415\&    \- 12:34\&    \- 123 this is an error.Ve.IP "single quoted scalar" 4.IX Item "single quoted scalar"This is similar to Perl's use of single quotes. It means no escapingexcept for single quotes which are escaped by using two adjacentsingle quotes..Sp.Vb 1\&    \- \*(AqWhen I say \*(Aq\*(Aq\en\*(Aq\*(Aq I mean "backslash en"\*(Aq.Ve.IP "double quoted scalar" 4.IX Item "double quoted scalar"This is similar to Perl's use of double quotes. Character escaping canbe used..Sp.Vb 1\&    \- "This scalar\enhas two lines, and a bell \-\->\ea".Ve.IP "folded scalar" 4.IX Item "folded scalar"This is a multiline scalar which begins on the next line. It isindicated by a single right angle bracket. It is unescaped like thesingle quoted scalar. Line folding is also performed..Sp.Vb 6\&    \- > \&     This is a multiline scalar which begins on\&     the next line. It is indicated by a single\&     carat. It is unescaped like the single\&     quoted scalar. Line folding is also\&     performed..Ve.IP "block scalar" 4.IX Item "block scalar"This final multiline form is akin to Perl's here-document except that(as in all \s-1YAML\s0 data) scope is indicated by indentation. Therefore, noending marker is required. The data is verbatim. No line folding..Sp.Vb 5\&    \- |\&        QTY  DESC          PRICE  TOTAL\&        \-\-\-  \-\-\-\-          \-\-\-\-\-  \-\-\-\-\-\&          1  Foo Fighters  $19.95 $19.95\&          2  Bar Belles    $29.95 $59.90.Ve.IP "parser" 4.IX Item "parser"A \s-1YAML\s0 processor has four stages: parse, load, dump, emit..SpA parser parses a \s-1YAML\s0 stream. \s-1YAML\s0.pm's \fILoad()\fR function contains aparser..IP "loader" 4.IX Item "loader"The other half of the \fILoad()\fR function is a loader. This takes theinformation from the parser and loads it into a Perl data structure..IP "dumper" 4.IX Item "dumper"The \fIDump()\fR function consists of a dumper and an emitter. The dumperwalks through each Perl data structure and gives info to the emitter..IP "emitter" 4.IX Item "emitter"The emitter takes info from the dumper and turns it into a \s-1YAML\s0 stream..Sp\&\s-1NOTE:\s0 In \s-1YAML\s0.pm the parser/loader and the dumper/emitter code are currentlyvery closely tied together. In the future they may be broken intoseparate stages..PPFor more information please refer to the immensely helpful \s-1YAML\s0specification available at <http://www.yaml.org/spec/>..SH "ysh \- The YAML Shell".IX Header "ysh - The YAML Shell"The \s-1YAML\s0 distribution ships with a script called 'ysh', the \s-1YAML\s0 shell.ysh provides a simple, interactive way to play with \s-1YAML\s0. If you type inPerl code, it displays the result in \s-1YAML\s0. If you type in \s-1YAML\s0 it turnsit into Perl code..PPTo run ysh, (assuming you installed it along with \s-1YAML\s0.pm) simply type:.PP.Vb 1\&    ysh [options].Ve.PPPlease read the \f(CW\*(C`ysh\*(C'\fR documentation for the full details. There arelots of options..SH "BUGS & DEFICIENCIES".IX Header "BUGS & DEFICIENCIES"If you find a bug in \s-1YAML\s0, please try to recreate it in the \s-1YAML\s0 Shellwith logging turned on ('ysh \-L'). When you have successfully reproducedthe bug, please mail the \s-1LOG\s0 file to the author (ingy@cpan.org)..PP\&\s-1WARNING:\s0 This is still *ALPHA* code. Well, most of this code has beenaround for years....PP\&\s-1BIGGER\s0 \s-1WARNING:\s0 \s-1YAML\s0.pm has been slow in the making, but I am committedto having top notch \s-1YAML\s0 tools in the Perl world. The \s-1YAML\s0 team is closeto finalizing the \s-1YAML\s0 1.1 spec. This version of \s-1YAML\s0.pm is based off ofa very old pre 1.0 spec. In actuality there isn't a ton of difference,and this \s-1YAML\s0.pm is still fairly useful. Things will get much better inthe future..SH "RESOURCES".IX Header "RESOURCES"<http://lists.sourceforge.net/lists/listinfo/yaml\-core> is the mailinglist. This is where the language is discussed and designed..PP<http://www.yaml.org> is the official \s-1YAML\s0 website..PP<http://www.yaml.org/spec/> is the \s-1YAML\s0 1.0 specification..PP<http://yaml.kwiki.org> is the official \s-1YAML\s0 wiki..SH "SEE ALSO".IX Header "SEE ALSO"See YAML::Syck. Fast!.SH "AUTHOR".IX Header "AUTHOR"Ingy dA\*~Xt Net <ingy@cpan.org>.PPis resonsible for \s-1YAML\s0.pm..PPThe \s-1YAML\s0 serialization language is the result of years of collaborationbetween Oren Ben-Kiki, Clark Evans and Ingy dA\*~Xt Net. Several othershave added help along the way..SH "COPYRIGHT".IX Header "COPYRIGHT"Copyright (c) 2005, 2006. Ingy dA\*~Xt Net. All rights reserved..PPCopyright (c) 2001, 2002, 2005. Brian Ingerson. All rights reserved..PPThis program is free software; you can redistribute it and/or modify itunder the same terms as Perl itself..PPSee <http://www.perl.com/perl/misc/Artistic.html>

⌨️ 快捷键说明

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