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

📄 yaml.pm

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 PM
📖 第 1 页 / 共 2 页
字号:
This is the number of space characters to use for each indentation levelwhen doing a Dump(). The default is 2.By the way, YAML can use any number of characters for indentation at anylevel. So if you are editing YAML by hand feel free to do it anyway thatlooks pleasing to you; just be consistent for a given level.=item SortKeysDefault is 1. (true)Tells YAML.pm whether or not to sort hash keys when storing a document. YAML::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.=item StringifyDefault is 0. (false)Objects with string overloading should honor the overloading and dump thestringification of themselves, rather than the actual object's guts.=item UseHeaderDefault is 1. (true)This tells YAML.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 YAML header by definition.=item UseVersionDefault is 0. (false)Tells YAML.pm whether to include the YAML version on theseparator/header.    --- %YAML:1.0=item AnchorPrefixDefault is ''.Anchor names are normally numeric. YAML.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.=item UseCodeSetting the UseCode option is a shortcut to set both the DumpCode andLoadCode options at once. Setting UseCode to '1' tells YAML.pm to dumpPerl code references as Perl (using B::Deparse) and to load them backinto memory using eval(). The reason this has to be an option is thatusing eval() to parse untrusted code is, well, untrustworthy.=item DumpCodeDetermines if and how YAML.pm should serialize Perl code references. Bydefault YAML.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.DumpCode can also be set to a subroutine reference so that you canwrite your own serializing routine. YAML.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'.=item LoadCodeLoadCode is the opposite of DumpCode. It tells YAML if and how todeserialize code references. When set to '1' or 'deparse' it will useC<eval()>. Since this is potentially risky, only use this option if youknow where your YAML has been.LoadCode can also be set to a subroutine reference so that you can writeyour own deserializing routine. YAML.pm passes the serialization (as astring) and a format indicator. You pass back the code reference.=item UseBlockYAML.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.NOTE: YAML's block style is akin to Perl's here-document. =item UseFoldIf you want to force YAML to use the 'folded' style for all multilinescalars, then set $UseFold to 1.NOTE: YAML's folded style is akin to the way HTML folds text,      except smarter.=item UseAliasesYAML 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 YAML can serialize duplicate andrecursive structures.Sometimes, when you KNOW 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 $YAML::UseAliases to 0 will allow youto do this. This also may result in faster processing because the lookupoverhead is by bypassed.THIS OPTION CAN BE DANGEROUS. *If* your data is recursive, this option*will* cause Dump() to run in an endless loop, chewing up your computersmemory. You have been warned.=item CompressSeriesDefault is 1.Compresses the formatting of arrays of hashes:    -      foo: bar    -       bar: foobecomes:    - foo: bar    - bar: fooSince this output is usually more desirable, this option is turned on bydefault.=back=head1 YAML TERMINOLOGYYAML is a full featured data serialization language, and thus has itsown terminology.It is important to remember that although YAML is heavily influenced byPerl and Python, it is a language in its own right, not merely just arepresentation of Perl structures.YAML 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, YAML can be extended to representPerl's Glob or Python's tuple, or Ruby's Bigint.=over 4=item streamA YAML stream is the full sequence of unicode characters that a YAMLparser would read or a YAML emitter would write. A stream may containone or more YAML documents separated by YAML headers.    ---    a: mapping    foo: bar    ---    - a    - sequence=item documentA YAML document is an independent data structure representation within astream. It is a top level node. Each document in a YAML stream mustbegin with a YAML header line. Actually the header is optional on thefirst document.    ---    This: top level mapping    is:        - a        - YAML        - document=item headerA YAML header is a line that begins a YAML 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.    --- !recursive-sequence &001    - * 001    - * 001=item nodeA YAML 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.)=item tagThis is similar to a type. It indicates how a particular YAML nodeserialization should be transferred into or out of memory. For instancea Foo::Bar object would use the tag 'perl/Foo::Bar':    - !perl/Foo::Bar        foo: 42        bar: stool=item collectionA collection is the generic term for a YAML data grouping. YAML has twotypes of collections: mappings and sequences. (Similar to hashes and arrays)=item mappingA mapping is a YAML collection defined by unordered key/value pairs withunique keys. By default YAML mappings are loaded into Perl hashes.    a mapping:        foo: bar        two: times two is 4=item sequenceA sequence is a YAML collection defined by an ordered list of elements. Bydefault YAML sequences are loaded into Perl arrays.    a sequence:        - one bourbon        - one scotch        - one beer=item scalarA scalar is a YAML node that is a single value. By default YAML scalarsare loaded into Perl scalars.    a scalar key: a scalar valueYAML has many styles for representing scalars. This is important becausevarying data will have varying formatting requirements to retain theoptimum human readability.=item plain scalarA plain sclar is unquoted. All plain scalars are automatic candidatesfor "implicit tagging". 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.    - a plain string    - -42    - 3.1415    - 12:34    - 123 this is an error=item single quoted scalarThis is similar to Perl's use of single quotes. It means no escapingexcept for single quotes which are escaped by using two adjacentsingle quotes.    - 'When I say ''\n'' I mean "backslash en"'=item double quoted scalarThis is similar to Perl's use of double quotes. Character escaping canbe used.    - "This scalar\nhas two lines, and a bell -->\a"=item folded scalarThis 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.    - >      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.=item block scalarThis final multiline form is akin to Perl's here-document except that(as in all YAML data) scope is indicated by indentation. Therefore, noending marker is required. The data is verbatim. No line folding.    - |        QTY  DESC          PRICE  TOTAL        ---  ----          -----  -----          1  Foo Fighters  $19.95 $19.95          2  Bar Belles    $29.95 $59.90=item parserA YAML processor has four stages: parse, load, dump, emit. A parser parses a YAML stream. YAML.pm's Load() function contains aparser.=item loaderThe other half of the Load() function is a loader. This takes theinformation from the parser and loads it into a Perl data structure.=item dumperThe Dump() function consists of a dumper and an emitter. The dumperwalks through each Perl data structure and gives info to the emitter.=item emitterThe emitter takes info from the dumper and turns it into a YAML stream. NOTE: In YAML.pm the parser/loader and the dumper/emitter code are currentlyvery closely tied together. In the future they may be broken intoseparate stages.=backFor more information please refer to the immensely helpful YAMLspecification available at L<http://www.yaml.org/spec/>.=head1 ysh - The YAML ShellThe YAML distribution ships with a script called 'ysh', the YAML shell.ysh provides a simple, interactive way to play with YAML. If you type inPerl code, it displays the result in YAML. If you type in YAML it turnsit into Perl code.To run ysh, (assuming you installed it along with YAML.pm) simply type:    ysh [options]Please read the C<ysh> documentation for the full details. There arelots of options.=head1 BUGS & DEFICIENCIESIf you find a bug in YAML, please try to recreate it in the YAML Shellwith logging turned on ('ysh -L'). When you have successfully reproducedthe bug, please mail the LOG file to the author (ingy@cpan.org).WARNING: This is still *ALPHA* code. Well, most of this code has beenaround for years...BIGGER WARNING: YAML.pm has been slow in the making, but I am committedto having top notch YAML tools in the Perl world. The YAML team is closeto finalizing the YAML 1.1 spec. This version of YAML.pm is based off ofa very old pre 1.0 spec. In actuality there isn't a ton of difference,and this YAML.pm is still fairly useful. Things will get much better inthe future.=head1 RESOURCESL<http://lists.sourceforge.net/lists/listinfo/yaml-core> is the mailinglist. This is where the language is discussed and designed.L<http://www.yaml.org> is the official YAML website.L<http://www.yaml.org/spec/> is the YAML 1.0 specification.L<http://yaml.kwiki.org> is the official YAML wiki.=head1 SEE ALSOSee YAML::Syck. Fast!=head1 AUTHORIngy d枚t Net <ingy@cpan.org>is resonsible for YAML.pm.The YAML serialization language is the result of years of collaborationbetween Oren Ben-Kiki, Clark Evans and Ingy d枚t Net. Several othershave added help along the way.=head1 COPYRIGHTCopyright (c) 2005, 2006. Ingy d枚t Net. All rights reserved.Copyright (c) 2001, 2002, 2005. Brian Ingerson. All rights reserved.This program is free software; you can redistribute it and/or modify itunder the same terms as Perl itself.See L<http://www.perl.com/perl/misc/Artistic.html>=cut

⌨️ 快捷键说明

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