home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / YAML.pod < prev    next >
Encoding:
Text File  |  2002-06-24  |  24.3 KB  |  842 lines

  1. =head1 NAME
  2.  
  3. YAML - YAML Ain't Markup Language (tm)
  4.  
  5. =head1 SYNOPSIS
  6.  
  7.     use YAML;
  8.     
  9.     # Load a YAML stream of 3 YAML documents into Perl data structures.
  10.     my ($hashref, $arrayref, $string) = Load(<<'...');
  11.     ---
  12.     name: ingy
  13.     age: old
  14.     weight: heavy
  15.     # I should comment that I also like pink, but don't tell anybody.
  16.     favorite colors:
  17.         - red
  18.         - white
  19.         - blue
  20.     ---
  21.     - Clark Evans
  22.     - Oren Ben-Kiki
  23.     - Brian Ingerson
  24.     --- >
  25.     You probably think YAML stands for "Yet Another Markup Language". It
  26.     ain't! YAML is really a data serialization language. But if you want
  27.     to think of it as a markup, that's OK with me. A lot of people try
  28.     to use XML as a serialization format.
  29.     
  30.     "YAML" is catchy and fun to say. Try it. "YAML, YAML, YAML!!!"
  31.     ...
  32.     
  33.     # Dump the Perl data structures back into YAML.
  34.     print Dump($string, $arrayref, $hashref); 
  35.     
  36.     # YAML::Dump is used the same way you'd use Data::Dumper::Dumper
  37.     use Data::Dumper;
  38.     print Dumper($string, $arrayref, $hashref); 
  39.  
  40. =head1 DESCRIPTION
  41.  
  42. The YAML.pm module implements a YAML Loader and Dumper based on the YAML
  43. 1.0 specification. L<http://www.yaml.org/spec/>
  44.  
  45. YAML is a generic data serialization language that is optimized for
  46. human readability. It can be used to express the data structures of most
  47. modern programming languages. (Including Perl!!!)
  48.  
  49. For information on the YAML syntax, please refer to the YAML
  50. specification.
  51.  
  52. =head1 WHY YAML IS COOL
  53.  
  54. =over 4
  55.  
  56. =item YAML is readable for people. 
  57.  
  58. It makes clear sense out of complex data structures. You should find
  59. that YAML is an exceptional data dumping tool. Structure is shown
  60. through indentation, YAML supports recursive data, and hash keys are
  61. sorted by default. In addition, YAML supports several styles of scalar
  62. formatting for different types of data.
  63.  
  64. =item YAML is editable.
  65.  
  66. YAML was designed from the ground up to be an excellent syntax for
  67. configuration files. Almost all programs need configuration files, so
  68. why invent a new syntax for each one? And why subject users to the
  69. complexities of XML or native Perl code?
  70.  
  71. =item YAML is multilingual.
  72.  
  73. Yes, YAML supports Unicode. But I'm actually referring to programming
  74. languages. YAML was designed to meet the serialization needs of Perl,
  75. Python, Ruby, Tcl, PHP and Java. It was also designed to be
  76. interoperable between those languages. That means any YAML serialization
  77. produced by Perl can be processed by Python, and be guaranteed to return
  78. the data structure intact. (Even if it contained Perl specific
  79. structures like GLOBs)
  80.  
  81. =item YAML is taint safe.
  82.  
  83. Using modules like Data::Dumper for serialization is fine as long as you
  84. can be sure that nobody can tamper with your data files or
  85. transmissions. That's because you need to use Perl's C<eval()> built-in
  86. to deserialize the data. Somebody could add a snippet of Perl to erase
  87. your files.
  88.  
  89. YAML's parser does not need to eval anything.
  90.  
  91. =item YAML is full featured.
  92.  
  93. YAML can accurately serialize all of the common Perl data structures and
  94. deserialize them again without losing data relationships. Although it is
  95. not 100% perfect (no serializer is or can be perfect), it fares as well
  96. as the popular current modules: Data::Dumper, Storable, XML::Dumper and
  97. Data::Denter.
  98.  
  99. YAML.pm also has the ability to handle code (subroutine) references and
  100. typeglobs. (Still experimental) These features are not found in Perl's
  101. other serialization modules.
  102.  
  103. =item YAML is extensible.
  104.  
  105. The YAML language has been designed to be flexible enough to solve it's
  106. own problems. The markup itself has 3 basic construct which resemble
  107. Perl's hash, array and scalar. By default, these map to their Perl
  108. equivalents. But each YAML node also supports a type (or "transfer
  109. method") which can cause that node to be interpreted in a completely
  110. different manner. That's how YAML can support oddball structures like
  111. Perl's typeglob.
  112.  
  113. =item YAML.pm plays well with others.
  114.  
  115. YAML has been designed to interact well with other Perl Modules like POE
  116. and Time::Object. (date support coming soon)
  117.  
  118. =back
  119.  
  120. =head1 USAGE
  121.  
  122. =head2 Exported Functions
  123.  
  124. The following functions are exported by YAML.pm by default when you use
  125. YAML.pm like this:
  126.  
  127.     use YAML;
  128.  
  129. To prevent YAML.pm from exporting functions, say:
  130.  
  131.     use YAML ();
  132.  
  133. =over 4
  134.  
  135. =item Dump(list-of-Perl-data-structures)
  136.  
  137. Turn Perl data into YAML. This function works very much like
  138. Data::Dumper::Dumper(). It takes a list of Perl data strucures and
  139. dumps them into a serialized form. It returns a string containing the
  140. YAML stream. The structures can be references or plain scalars.
  141.  
  142. =item Load(string-containing-a-YAML-stream)
  143.  
  144. Turn YAML into Perl data. This is the opposite of Dump. Just like
  145. Storable's thaw() function or the eval() function in relation to
  146. Data::Dumper. It parses a string containing a valid YAML stream into a
  147. list of Perl data structures. 
  148.  
  149. =item Store()
  150.  
  151. This function is deprecated, and now refered to as Dump. It is still available
  152. for the time being, but will generate a warning if you are using -w. You
  153. B<are> using -w, aren't you? :)
  154.  
  155. The reason for this deprecation is that the YAML spec talks about programs
  156. called Loaders and Dumpers. "Storers" is too hard to say, I guess...
  157.  
  158. =back
  159.  
  160. =head2 Exportable Functions
  161.  
  162. =over 4
  163.  
  164. =item DumpFile(filepath, list)
  165.  
  166. Writes the YAML stream to a file instead of just returning a string.
  167.  
  168. =item LoadFile(filepath)
  169.  
  170. Reads the YAML stream from a file instead of a string.
  171.  
  172. =item Bless(perl-node, [yaml-node | class-name])
  173.  
  174. Associate a normal Perl node, with a yaml node. A yaml node is an object
  175. tied to the YAML::Node class. The second argument is either a yaml node
  176. that you've already created or a class (package) name that supports a
  177. yaml_dump() function. A yaml_dump() function should take a perl node and
  178. return a yaml node. If no second argument is provided, Bless will create a
  179. yaml node. This node is not returned, but can be retrieved with the Blessed()
  180. function.
  181.  
  182. Here's an example of how to use Bless. Say you have a hash containing three
  183. keys, but you only want to dump two of them. Furthermore the keys must be
  184. dumped in a certain order. Here's how you do that:
  185.  
  186.     use YAML qw(Dump Bless);
  187.     $hash = {apple => 'good', banana => 'bad', cauliflower => 'ugly'};
  188.     print Dump $hash;
  189.     Bless($hash)->keys(['banana', 'apple']);
  190.     print Dump $hash;
  191.  
  192. produces:
  193.  
  194.     --- #YAML:1.0
  195.     apple: good
  196.     banana: bad
  197.     cauliflower: ugly
  198.     --- #YAML:1.0
  199.     banana: bad
  200.     apple: good
  201.  
  202. Bless returns the tied part of a yaml-node, so that you can call the
  203. YAML::Node methods. This is the same thing that YAML::Node::ynode()
  204. returns. So another way to do the above example is:
  205.  
  206.     use YAML qw(:all);
  207.     use YAML::Node;
  208.     $hash = {apple => 'good', banana => 'bad', cauliflower => 'ugly'};
  209.     print Dump $hash;
  210.     Bless($hash);
  211.     $ynode = ynode(Blessed($hash));
  212.     $ynode->keys(['banana', 'apple']);
  213.     print Dump $hash;
  214.  
  215. =item Blessed(perl-node)
  216.  
  217. Returns the yaml node that a particular perl node is associated with
  218. (see above). Returns undef if the node is not (YAML) blessed.
  219.  
  220. =item Dumper()
  221.  
  222. Alias to Dump(). For Data::Dumper fans.
  223.  
  224. =item freeze() and thaw()
  225.  
  226. Aliases to Dump() and Load(). For Storable fans.
  227.  
  228. This will also allow YAML.pm to be plugged directly into modules like POE.pm,
  229. that use the freeze/thaw API for internal serialization.
  230.  
  231. =back
  232.  
  233. =head2 Exportable Function Groups
  234.  
  235. This is a list of the various groups of exported functions that you can import
  236. using the following syntax:
  237.  
  238.     use YAML ':groupname';
  239.  
  240. =over 4
  241.  
  242. =item all
  243.  
  244. Imports Dump(), Load(), Store(), DumpFile(), LoadFile(), Bless() and Blessed().
  245.  
  246. =item POE
  247.  
  248. Imports freeze() and thaw().
  249.  
  250. =item Storable
  251.  
  252. Imports freeze() and thaw().
  253.  
  254. =back
  255.  
  256. =head2 Class Methods
  257.  
  258. YAML can also be used in an object oriented manner. At this point it
  259. offers no real advantage. This interface will be improved in a later
  260. release.
  261.  
  262. =over 4
  263.  
  264. =item new()
  265.  
  266. New returns a new YAML object. For example:
  267.  
  268.     my $y = YAML->new;
  269.     $y->Indent(4);
  270.     $y->dump($foo, $bar);
  271.  
  272. =back
  273.  
  274. =head2 Object Methods
  275.  
  276. =over 4
  277.  
  278. =item dump()
  279.  
  280. OO version of Dump().
  281.  
  282. =item load()
  283.  
  284. OO version of Load().
  285.  
  286. =back
  287.  
  288. =head2 Options
  289.  
  290. YAML options are set using a group of global variables in the YAML
  291. namespace. This is similar to how Data::Dumper works.
  292.  
  293. For example, to change the indentation width, do something like:
  294.  
  295.     local $YAML::Indent = 3;
  296.  
  297. The current options are:
  298.  
  299. =over 4
  300.  
  301. =item Indent
  302.  
  303. This is the number of space characters to use for each indentation level
  304. when doing a Dump(). The default is 2.
  305.  
  306. By the way, YAML can use any number of characters for indentation at any
  307. level. So if you are editing YAML by hand feel free to do it anyway that
  308. looks pleasing to you; just be consistent for a given level.
  309.  
  310. =item UseHeader
  311.  
  312. Default is 1. (true)
  313.  
  314. This tells YAML.pm whether to use a separator string for a Dump
  315. operation. This only applies to the first document in a stream.
  316. Subsequent documents must have a YAML header by definition.
  317.  
  318. =item UseVersion
  319.  
  320. Default is 1. (true)
  321.  
  322. Tells YAML.pm whether to include the YAML version on the
  323. separator/header.
  324.  
  325. The canonical form is:
  326.  
  327.     --- YAML:1.0
  328.  
  329. =item SortKeys
  330.  
  331. Default is 1. (true)
  332.  
  333. Tells YAML.pm whether or not to sort hash keys when storing a document. 
  334.  
  335. YAML::Node objects can have their own sort order, which is usually what
  336. you want. To override the YAML::Node order and sort the keys anyway, set
  337. SortKeys to 2.
  338.  
  339. =item AnchorPrefix
  340.  
  341. Default is ''.
  342.  
  343. Anchor names are normally numeric. YAML.pm simply starts with '1' and
  344. increases by one for each new anchor. This option allows you to specify a
  345. string to be prepended to each anchor number.
  346.  
  347. =item UseCode
  348.  
  349. Setting the UseCode option is a shortcut to set both the DumpCode and
  350. LoadCode options at once. Setting UseCode to '1' tells YAML.pm to dump
  351. Perl code references as Perl (using B::Deparse) and to load them back
  352. into memory using eval(). The reason this has to be an option is that
  353. using eval() to parse untrusted code is, well, untrustworthy. Safe
  354. deserialization is one of the core goals of YAML.
  355.  
  356. =item DumpCode
  357.  
  358. Determines if and how YAML.pm should serialize Perl code references. By
  359. default YAML.pm will dump code references as dummy placeholders (much
  360. like Data::Dumper). If DumpCode is set to '1' or 'deparse', code
  361. references will be dumped as actual Perl code.
  362.  
  363. DumpCode can also be set to a subroutine reference so that you can
  364. write your own serializing routine. YAML.pm passes you the code ref. You
  365. pass back the serialization (as a string) and a format indicator. The
  366. format indicator is a simple string like: 'deparse' or 'bytecode'.
  367.  
  368. =item LoadCode
  369.  
  370. LoadCode is the opposite of DumpCode. It tells YAML if and how to
  371. deserialize code references. When set to '1' or 'deparse' it will use
  372. C<eval()>. Since this is potentially risky, only use this option if you
  373. know where your YAML has been.
  374.  
  375. LoadCode can also be set to a subroutine reference so that you can write
  376. your own deserializing routine. YAML.pm passes the serialization (as a
  377. string) and a format indicator. You pass back the code reference.
  378.  
  379. =item UseBlock
  380.  
  381. YAML.pm uses heuristics to guess which scalar style is best for a given
  382. node. Sometimes you'll want all multiline scalars to use the 'block'
  383. style. If so, set this option to 1.
  384.  
  385. NOTE: YAML's block style is akin to Perl's here-document. 
  386.  
  387. =item ForceBlock
  388.  
  389. Force every possible scalar to be block formatted. NOTE: Escape characters
  390. cannot be formatted in a block scalar.
  391.  
  392. =item UseFold
  393.  
  394. If you want to force YAML to use the 'folded' style for all multiline
  395. scalars, then set $UseFold to 1.
  396.  
  397. NOTE: YAML's folded style is akin to the way HTML folds text,
  398.       except smarter.
  399.  
  400. =item UseAliases
  401.  
  402. YAML has an alias mechanism such that any given structure in memory gets
  403. serialized once. Any other references to that structure are serialized
  404. only as alias markers. This is how YAML can serialize duplicate and
  405. recursive structures.
  406.  
  407. Sometimes, when you KNOW that your data is nonrecursive in nature, you
  408. may want to serialize such that every node is expressed in full. (ie as
  409. a copy of the original). Setting $YAML::UseAliases to 0 will allow you
  410. to do this. This also may result in faster processing because the lookup
  411. overhead is by bypassed.
  412.  
  413. THIS OPTION CAN BE DANGEROUS. *If* your data is recursive, this option
  414. *will* cause Dump() to run in an endless loop, chewing up your computers
  415. memory. You have been warned.
  416.  
  417. =item CompressSeries
  418.  
  419. Default is 1.
  420.  
  421. Compresses the formatting of arrays of hashes:
  422.  
  423.     -
  424.       foo: bar
  425.     - 
  426.       bar: foo
  427.  
  428. becomes:
  429.  
  430.     - foo: bar
  431.     - bar: foo
  432.  
  433. Since this output is usually more desirable, this option is turned on by
  434. default.
  435.  
  436. =back
  437.  
  438. =head1 YAML TERMINOLOGY
  439.  
  440. YAML is a full featured data serialization language, and thus has its
  441. own terminology.
  442.  
  443. It is important to remember that although YAML is heavily influenced by
  444. Perl and Python, it is a language in it's own right, not merely just a
  445. representation of Perl structures.
  446.  
  447. YAML has three constructs that are conspicuously similar to Perl's hash,
  448. array, and scalar. They are called mapping, sequence, and string
  449. respectively. By default, they do what you would expect. But each
  450. instance may have an explicit or implicit type that makes it behave
  451. differently. In this manner, YAML can be extended to represent Perl's
  452. Glob or Python's tuple, or Ruby's Bigint.
  453.  
  454. =over 4
  455.  
  456. =item stream
  457.  
  458. A YAML stream is the full sequence of bytes that a YAML parser would
  459. read or a YAML emitter would write. A stream may contain one or more YAML
  460. documents separated by YAML headers.
  461.  
  462.     ---
  463.     a: mapping
  464.     foo: bar
  465.     ---
  466.     - a
  467.     - sequence
  468.  
  469. =item document
  470.  
  471. A YAML document is an independent data structure representation within a
  472. stream. It is a top level node.
  473.  
  474.     --- YAML:1.0
  475.     This: top level mapping
  476.     is:
  477.         - a
  478.         - YAML
  479.         - document
  480.  
  481. =item node
  482.  
  483. A YAML node is the representation of a particular data stucture. Nodes
  484. may contain other nodes. (In Perl terms, nodes are like scalars.
  485. Strings, arrayrefs and hashrefs. But this refers to the serialized
  486. format, not the in-memory structure.)
  487.  
  488. =item transfer method
  489.  
  490. This is similar to a type. It indicates how a particular YAML node
  491. serialization should be transferred into or out of memory. For instance
  492. a Foo::Bar object would use the transfer 'perl/Foo::Bar':
  493.  
  494.     - !perl/Foo::Bar
  495.         foo: 42
  496.         bar: stool
  497.  
  498. =item collection
  499.  
  500. A collection is the generic term for a YAML data grouping. YAML has two
  501. types of collections: mappings and sequences. (Similar to hashes and arrays)
  502.  
  503. =item mapping
  504.  
  505. A mapping is a YAML collection defined by key/value pairs. By default YAML
  506. mappings are loaded into Perl hashes.
  507.  
  508.     a mapping:
  509.         foo: bar
  510.         two: times two is 4
  511.  
  512. =item sequence
  513.  
  514. A sequence is a YAML collection defined by an ordered list of elements. By
  515. default YAML sequences are loaded into Perl arrays.
  516.  
  517.     a sequence:
  518.         - one bourbon
  519.         - one scotch
  520.         - one beer
  521.  
  522. =item scalar
  523.  
  524. A scalar is a YAML node that is a single value. By default YAML scalars
  525. are loaded into Perl scalars.
  526.  
  527.     a scalar key: a scalar value
  528.  
  529. YAML has many styles for representing scalars. This is important because
  530. varying data will have varying formatting requirements to retain the
  531. optimum human readability.
  532.  
  533. =item simple scalar
  534.  
  535. This is a single line of unquoted text. All simple scalars are automatic
  536. candidates for "implicit transferring". This means that their B<type> is
  537. determined automatically by examination. Unless they match a set of
  538. predetermined YAML regex patterns, they will raise a parser exception.
  539. The typical uses for this are simple alpha strings, integers, real
  540. numbers, dates, times and currency.
  541.  
  542.     - a simple string
  543.     - -42
  544.     - 3.1415
  545.     - 12:34
  546.     - 123 this is an error
  547.  
  548. =item single quoted scalar
  549.  
  550. This is similar to Perl's use of single quotes. It means no escaping and
  551. no implicit transfer. It must be used on a single line.
  552.  
  553.     - 'When I say ''\n'' I mean "backslash en"'
  554.  
  555. =item double quoted scalar
  556.  
  557. This is similar to Perl's use of double quotes. Character escaping can
  558. be used. There is no implicit transfer and it must still be single line.
  559.  
  560.     - "This scalar\nhas two lines, and a bell -->\a"
  561.  
  562. =item folded scalar
  563.  
  564. This is a multiline scalar which begins on the next line. It is
  565. indicated by a single closing brace. It is unescaped like the single
  566. quoted scalar. Line folding is also performed.
  567.  
  568.     - > 
  569.      This is a multiline scalar which begins on
  570.      the next line. It is indicated by a single
  571.      carat. It is unescaped like the single
  572.      quoted scalar. Line folding is also
  573.      performed.
  574.  
  575. =item block scalar
  576.  
  577. This final multiline form is akin to Perl's here-document except that
  578. (as in all YAML data) scope is indicated by indentation. Therefore, no
  579. ending marker is required. The data is verbatim. No line folding.
  580.  
  581.     - |
  582.         QTY  DESC          PRICE  TOTAL
  583.         ---  ----          -----  -----
  584.           1  Foo Fighters  $19.95 $19.95
  585.           2  Bar Belles    $29.95 $59.90
  586.  
  587. =item parser
  588.  
  589. A YAML processor has four stages: parse, load, dump, emit. 
  590.  
  591. A parser parses a YAML stream. YAML.pm's Load() function contains a
  592. parser.
  593.  
  594. =item loader
  595.  
  596. The other half of the Load() function is a loader. This takes the
  597. information from the parser and loads it into a Perl data structure.
  598.  
  599. =item dumper
  600.  
  601. The Dump() function consists of a dumper and an emitter. The dumper
  602. walks through each Perl data structure and gives info to the emitter.
  603.  
  604. =item emitter
  605.  
  606. The emitter takes info from the dumper and turns it into a YAML stream. 
  607.  
  608. NOTE: 
  609. In YAML.pm the parser/loader and the dumper/emitter code are currently
  610. very closely tied together. When libyaml is written (in C) there will be
  611. a definite separation. libyaml will contain a parser and emitter, and
  612. YAML.pm (and YAML.py etc) will supply the loader and dumper.
  613.  
  614. =back
  615.  
  616. For more information please refer to the immensely helpful YAML
  617. specification available at L<http://www.yaml.org/spec/>.
  618.  
  619. =head1 ysh - The YAML Shell
  620.  
  621. The YAML distribution ships with a script called 'ysh', the YAML shell.
  622. ysh provides a simple, interactive way to play with YAML. If you type in
  623. Perl code, it displays the result in YAML. If you type in YAML it turns
  624. it into Perl code.
  625.  
  626. To run ysh, (assuming you installed it along with YAML.pm) simply type:
  627.  
  628.     ysh [options]
  629.  
  630. Please read L<ysh> for the full details. There are lots of options.
  631.  
  632. =head1 BUGS & DEFICIENCIES
  633.  
  634. If you find a bug in YAML, please try to recreate it in the YAML Shell
  635. with logging turned on ('ysh -L'). When you have successfully reproduced
  636. the bug, please mail the LOG file to the author (ingy@cpan.org).
  637.  
  638. WARNING: This is *ALPHA* code. 
  639.  
  640. BIGGER WARNING: This is *TRIAL1* of the YAML 1.0 specification. The YAML
  641. syntax may change before it is finalized. Based on past experience, it
  642. probably will change. The authors of this spec have worked for over a
  643. year putting together YAML 1.0, and we have flipped it on it's
  644. syntactical head almost every week. We're a fickle lot, we are. So use
  645. this at your own risk!!!
  646.  
  647. =over 4
  648.  
  649. =item Circular Leaves
  650.  
  651. YAML is quite capable of serializing circular references. And for the
  652. most part it can deserialize them correctly too. One notable exception
  653. is a reference to a leaf node containing itself. This is hard to do from
  654. pure Perl in any elegant way. The "canonical" example is:
  655.  
  656.     $foo = \$foo;
  657.  
  658. This serializes fine, but I can't parse it correctly yet. Unfortunately,
  659. every wiseguy programmer in the world seems to try this first when you
  660. ask them to test your serialization module. Even though it is of almost
  661. no real world value. So please don't report this bug unless you have a
  662. pure Perl patch to fix it for me.
  663.  
  664. By the way, similar non-leaf structures Dump and Load just fine:
  665.  
  666.     $foo->[0] = $foo;
  667.  
  668. You can test these examples using 'ysh -r'. This option makes sure that
  669. the example can be deserialized after it is serialized. We call that
  670. "roundtripping", thus the '-r'.
  671.  
  672. =item Unicode
  673.  
  674. Unicode is not yet supported. The YAML specification dictates that all
  675. strings be unicode, but this early implementation just uses ASCII.
  676.  
  677. =item Structured Keys
  678.  
  679. Python, Java and perhaps others support using any data type as the
  680. key to a hash. YAML also supports this. Perl5 only uses strings as
  681. hash keys.
  682.  
  683. YAML.pm can currently parse structured keys, but their meaning gets lost
  684. when they are loaded into a Perl hash. Consider this example using the
  685. YAML Shell:
  686.  
  687.     ysh > ---
  688.     yaml> ?
  689.     yaml>  foo: bar
  690.     yaml> : baz
  691.     yaml> ...
  692.     $VAR1 = {
  693.               'HASH(0x1f1d20)' => 'baz'
  694.             };
  695.     ysh >
  696.  
  697. YAML.pm will need to be fixed to preserve these keys somehow. Why?
  698. Because if YAML.pm gets a YAML document from YAML.py it must be able to
  699. return it with the Python data intact.
  700.  
  701. =item Globs, Subroutines, Regexes and File Handles
  702.  
  703. As far as I know, other Perl serialization modules are not capable of
  704. serializing and deserializing typeglobs, subroutines (code refs),
  705. regexes and file handles. YAML.pm has dumping capabilities for all of these.
  706. Loading them may produce wild results. Take care.
  707.  
  708. NOTE: For a (huge) dump of Perl's global guts, try:
  709.  
  710.     perl -MYAML -e '$YAML::UseCode=1; print Dump \%main::'
  711.  
  712. To limit this to a single namespace try:
  713.  
  714.     perl -MCGI -MYAML -e '$YAML::UseCode=1; print Dump \%CGI::'
  715.  
  716. =item Speed
  717.  
  718. This is a pure Perl implementation that has been optimized for
  719. programmer readability, not for computational speed. 
  720.  
  721. Neil Watkiss and Clark Evans are currently developing libyaml, the
  722. official C implementation of the YAML parser and emitter. YAML.pm will
  723. be refactoring to use this library once it is stable. Other languages
  724. like Python, Tcl, PHP, Ruby, JavaScript and Java can make use of the
  725. same core library.
  726.  
  727. Please join us on the YAML mailing list if you are interested in
  728. implementing something. 
  729.  
  730. L<https://lists.sourceforge.net/lists/listinfo/yaml-core>
  731.  
  732. =item Streaming Access
  733.  
  734. This module Dumps and Loads in one operation. There is no interface
  735. for parsing or emitting a YAML stream one node at a time. It's all
  736. or nothing.
  737.  
  738. An upcoming release will have support for incremental parsing.
  739. Incremental dumping is harder. Stay tuned.
  740.  
  741. =back
  742.  
  743. =head1 RESOURCES
  744.  
  745. Please read L<YAML::Node> for advanced YAML features.
  746.  
  747. L<http://www.yaml.org> is the official YAML website.
  748.  
  749. L<http://www.yaml.org/spec/> is the YAML 1.0 specification.
  750.  
  751. L<http://wiki.yaml.org/spec/> is the official YAML wiki.
  752.  
  753. YAML has been registered as a Source Forge project.
  754. (L<http://www.sourceforge.net>) Currently we are only using the mailing
  755. list facilities there.
  756.  
  757. =head1 IMPLEMENTATIONS
  758.  
  759. This is the first implementation of YAML functionality based on the 1.0
  760. specification.
  761.  
  762. The following people have shown an interest in doing implementations.
  763. Please contact them if you are also interested in writing an
  764. implementation.
  765.  
  766.     ---
  767.     - name:    Neil Watkiss
  768.       project: 
  769.         - libyaml
  770.         - YAML mode for the vim editor
  771.       email:   nwatkiss@ttul.org
  772.  
  773.     - name:    Brian Ingerson
  774.       project: YAML.pm, libyaml Perl binding
  775.       email:   ingy@ttul.org
  776.     
  777.     - name:    Clark Evans
  778.       project: libyaml, Python binding
  779.       email:   cce@clarkevans.com
  780.  
  781.     - name:    Oren Ben-Kiki
  782.       project: Java Loader/Dumper
  783.       email:   orenbk@richfx.com
  784.  
  785.     - name:    Paul Prescod
  786.       project: YAML Antagonist/Anarchist
  787.       email:   paul@prescod.net
  788.  
  789.     - name:    Ryan King
  790.       project: YAML test specialist
  791.       email:   rking@panoptic.com
  792.  
  793.     - name:    Steve Howell
  794.       project: Python and Ruby implementations
  795.       email:   showell@zipcon.net
  796.  
  797.     - name:    Patrick Leboutillier
  798.       project: Java Loader/Dumper
  799.       email:   patrick_leboutillier@hotmail.com
  800.  
  801.     - name:    Shane Caraveo
  802.       project: PHP Loader/Dumper
  803.       email:   shanec@activestate.com
  804.  
  805.     - name:    Brian Quinlan
  806.       project: Python Loader/Dumper
  807.       email:   brian@sweetapp.com
  808.  
  809.     - name:    Jeff Hobbs
  810.       project: Tcl Loader/Dumper
  811.       email:   jeff@hobbs.org
  812.  
  813.     - name:    Claes Jacobsson
  814.       project: JavaScript Loader/Dumper
  815.       email:   claes@contiller.se
  816.  
  817. =head1 AUTHOR
  818.  
  819. Brian Ingerson <INGY@cpan.org> is resonsible for YAML.pm.
  820.  
  821. The YAML language is the result of a ton of collaboration between Oren
  822. Ben-Kiki, Clark Evans and Brian Ingerson. Several others have added help
  823. along the way.
  824.  
  825. Neil Watkiss is pioneering libyaml. Bless that boy!
  826.  
  827. Ryan King offered much help on the 0.35 release. The XP advocate
  828. extraordinaire, help me refactor my entire test suite into its
  829. current form. Regression tests are extremely important to the success
  830. of this project.
  831.  
  832. =head1 COPYRIGHT
  833.  
  834. Copyright (c) 2001, 2002. Brian Ingerson. All rights reserved.
  835.  
  836. This program is free software; you can redistribute it and/or modify it
  837. under the same terms as Perl itself.
  838.  
  839. See L<http://www.perl.com/perl/misc/Artistic.html>
  840.  
  841. =cut
  842.