iwai****@users*****
iwai****@users*****
2011年 2月 7日 (月) 01:20:01 JST
Index: docs/modules/YAML-0.35/YAML.pod diff -u docs/modules/YAML-0.35/YAML.pod:1.5 docs/modules/YAML-0.35/YAML.pod:1.6 --- docs/modules/YAML-0.35/YAML.pod:1.5 Thu Jan 27 22:15:10 2011 +++ docs/modules/YAML-0.35/YAML.pod Mon Feb 7 01:20:01 2011 @@ -42,7 +42,7 @@ =head1 DESCRIPTION -=begin orignal +=begin original The YAML.pm module implements a YAML Loader and Dumper based on the YAML 1.0 specification. L<http://www.yaml.org/spec/> @@ -52,7 +52,7 @@ YAML.pm モジュールは YAML 1.0 仕様 L<http://www.yaml.org/spec/> を 基にした YAML ローダとダンパを実装します。 -=begin orignal +=begin original YAML is a generic data serialization language that is optimized for human readability. It can be used to express the data structures of most @@ -64,7 +64,7 @@ ほとんどの現代のプログラミング言語(Perl を含みます!!!)のデータ構造を 記述するのに使えます。 -=begin orignal +=begin original For information on the YAML syntax, please refer to the YAML specification. @@ -145,7 +145,7 @@ =head2 Exported Functions -=begin orignal +=begin original The following functions are exported by YAML.pm by default when you use YAML.pm like this: @@ -157,7 +157,7 @@ use YAML; -=begin orignal +=begin original To prevent YAML.pm from exporting functions, say: @@ -171,7 +171,7 @@ =item Dump(list-of-Perl-data-structures) -=begin orignal +=begin original Turn Perl data into YAML. This function works very much like Data::Dumper::Dumper(). It takes a list of Perl data strucures and @@ -188,7 +188,7 @@ =item Load(string-containing-a-YAML-stream) -=begin orignal +=begin original Turn YAML into Perl data. This is the opposite of Dump. Just like Storable's thaw() function or the eval() function in relation to @@ -204,7 +204,7 @@ =item Store() -=begin orignal +=begin original This function is deprecated, and now refered to as Dump. It is still available for the time being, but will generate a warning if you are using -w. You @@ -216,7 +216,7 @@ 歴史的な理由によりまだ利用可能ですが、-w オプションを使っていると 警告を出力します。もちろんあなたは -w をB<使っている>でしょうね? :) -=begin orignal +=begin original The reason for this deprecation is that the YAML spec talks about programs called Loaders and Dumpers. "Storers" is too hard to say, I guess... @@ -235,7 +235,7 @@ =item DumpFile(filepath, list) -=begin orignal +=begin original Writes the YAML stream to a file instead of just returning a string. @@ -245,7 +245,7 @@ =item LoadFile(filepath) -=begin orignal +=begin original Reads the YAML stream from a file instead of a string. @@ -255,7 +255,7 @@ =item Bless(perl-node, [yaml-node | class-name]) -=begin orignal +=begin original Associate a normal Perl node, with a yaml node. A yaml node is an object tied to the YAML::Node class. The second argument is either a yaml node @@ -276,7 +276,7 @@ 2 番目の引数が与えられなかった場合、Bless 関数は YAML ノードを作成します。 このノードは返されませんが、Blessed() 関数で受け取ることができます。 -=begin orignal +=begin original Here's an example of how to use Bless. Say you have a hash containing three keys, but you only want to dump two of them. Furthermore the keys must be @@ -295,7 +295,7 @@ Bless($hash)->keys(['banana', 'apple']); print Dump $hash; -=begin orignal +=begin original produces: @@ -311,7 +311,7 @@ banana: bad apple: good -=begin orignal +=begin original Bless returns the tied part of a yaml-node, so that you can call the YAML::Node methods. This is the same thing that YAML::Node::ynode() @@ -335,7 +335,7 @@ =item Blessed(perl-node) -=begin orignal +=begin original Returns the yaml node that a particular perl node is associated with (see above). Returns undef if the node is not (YAML) blessed. @@ -348,7 +348,7 @@ =item Dumper() -=begin orignal +=begin original Alias to Dump(). For Data::Dumper fans. @@ -358,7 +358,7 @@ =item freeze() and thaw() -=begin orignal +=begin original Aliases to Dump() and Load(). For Storable fans. @@ -366,7 +366,7 @@ Dump() と Load() の別名です。Storable ファン用です。 -=begin orignal +=begin original This will also allow YAML.pm to be plugged directly into modules like POE.pm, that use the freeze/thaw API for internal serialization. @@ -380,7 +380,7 @@ =head2 Exportable Function Groups -=begin orignal +=begin original This is a list of the various groups of exported functions that you can import using the following syntax: @@ -396,7 +396,7 @@ =item all -=begin orignal +=begin original Imports Dump(), Load(), Store(), DumpFile(), LoadFile(), Bless() and Blessed(). @@ -407,7 +407,7 @@ =item POE -=begin orignal +=begin original Imports freeze() and thaw(). @@ -417,7 +417,7 @@ =item Storable -=begin orignal +=begin original Imports freeze() and thaw(). @@ -429,7 +429,7 @@ =head2 Class Methods -=begin orignal +=begin original YAML can also be used in an object oriented manner. At this point it offers no real advantage. This interface will be improved in a later @@ -445,7 +445,7 @@ =item new() -=begin orignal +=begin original New returns a new YAML object. For example: @@ -465,7 +465,7 @@ =item dump() -=begin orignal +=begin original OO version of Dump(). @@ -475,7 +475,7 @@ =item load() -=begin orignal +=begin original OO version of Load(). @@ -487,7 +487,7 @@ =head2 Options -=begin orignal +=begin original YAML options are set using a group of global variables in the YAML namespace. This is similar to how Data::Dumper works. @@ -497,7 +497,7 @@ YAML オプションは YAML 名前空間のグローバル変数を使って設定されます。 これは Data::Dumper と同じように動作します。 -=begin orignal +=begin original For example, to change the indentation width, do something like: @@ -507,7 +507,7 @@ local $YAML::Indent = 3; -=begin orignal +=begin original The current options are: @@ -519,7 +519,7 @@ =item Indent -=begin orignal +=begin original This is the number of space characters to use for each indentation level when doing a Dump(). The default is 2. @@ -529,7 +529,7 @@ Dump() したときに、インデントレベル毎に使う空白文字の数です。 デフォルトは 2 です。 -=begin orignal +=begin original By the way, YAML can use any number of characters for indentation at any level. So if you are editing YAML by hand feel free to do it anyway that @@ -543,7 +543,7 @@ =item UseHeader -=begin orignal +=begin original Default is 1. (true) @@ -561,7 +561,7 @@ =item UseVersion -=begin orignal +=begin original Default is 1. (true) @@ -582,7 +582,7 @@ =item SortKeys -=begin orignal +=begin original Default is 1. (true) @@ -594,7 +594,7 @@ YAML.pm が文書を保存するときにハッシュキーでソートするかどうかを指定します。 -=begin orignal +=begin original YAML::Node objects can have their own sort order, which is usually what you want. To override the YAML::Node order and sort the keys anyway, set @@ -609,7 +609,7 @@ =item AnchorPrefix -=begin orignal +=begin original Default is ''. @@ -627,7 +627,7 @@ =item UseCode -=begin orignal +=begin original Setting the UseCode option is a shortcut to set both the DumpCode and LoadCode options at once. Setting UseCode to '1' tells YAML.pm to dump @@ -649,7 +649,7 @@ =item DumpCode -=begin orignal +=begin original Determines if and how YAML.pm should serialize Perl code references. By default YAML.pm will dump code references as dummy placeholders (much @@ -663,7 +663,7 @@ (Data::Dumper と同様です)。DumpCode に '1' または 'deparse' を設定すると、 コードリファレンスは実際の Perl のコードとしてダンプします。 -=begin orignal +=begin original DumpCode can also be set to a subroutine reference so that you can write your own serializing routine. YAML.pm passes you the code ref. You @@ -681,7 +681,7 @@ =item LoadCode -=begin orignal +=begin original LoadCode is the opposite of DumpCode. It tells YAML if and how to deserialize code references. When set to '1' or 'deparse' it will use @@ -696,7 +696,7 @@ 潜在的なリスクがあるため、使用する YAML の出所がわかっているものに 対してのみ使用してください。 -=begin orignal +=begin original LoadCode can also be set to a subroutine reference so that you can write your own deserializing routine. YAML.pm passes the serialization (as a @@ -711,7 +711,7 @@ =item UseBlock -=begin orignal +=begin original YAML.pm uses heuristics to guess which scalar style is best for a given node. Sometimes you'll want all multiline scalars to use the 'block' @@ -724,7 +724,7 @@ 全ての複数行スカラを「ブロック」スタイルを使って出力したい場合が あるかもしれません。そのような場合、このオプションに 1 を指定します。 -=begin orignal +=begin original NOTE: YAML's block style is akin to Perl's here-document. @@ -734,7 +734,7 @@ =item ForceBlock -=begin orignal +=begin original Force every possible scalar to be block formatted. NOTE: Escape characters cannot be formatted in a block scalar. @@ -746,7 +746,7 @@ =item UseFold -=begin orignal +=begin original If you want to force YAML to use the 'folded' style for all multiline scalars, then set $UseFold to 1. @@ -756,7 +756,7 @@ 全ての複数行スカラを「折り畳み」スタイルで使いたい場合、 $UseFold に 1 を設定します。 -=begin orignal +=begin original NOTE: YAML's folded style is akin to the way HTML folds text, except smarter. @@ -768,7 +768,7 @@ =item UseAliases -=begin orignal +=begin original YAML has an alias mechanism such that any given structure in memory gets serialized once. Any other references to that structure are serialized @@ -783,7 +783,7 @@ 直列化されます。これにより複製されたり再帰的な構造体を 直列化できるようになります。 -=begin orignal +=begin original Sometimes, when you KNOW that your data is nonrecursive in nature, you may want to serialize such that every node is expressed in full. (ie as @@ -799,7 +799,7 @@ $YAML::UseAliases を 0 に設定すると、このようなことができるようになります。 また、検索オーバーヘッドを回避できるので、処理速度も速くなります。 -=begin orignal +=begin original THIS OPTION CAN BE DANGEROUS. *If* your data is recursive, this option *will* cause Dump() to run in an endless loop, chewing up your computers @@ -813,7 +813,7 @@ =item CompressSeries -=begin orignal +=begin original Default is 1. @@ -830,7 +830,7 @@ - bar: foo -=begin orignal +=begin original becomes: @@ -841,7 +841,7 @@ - foo: bar - bar: foo -=begin orignal +=begin original Since this output is usually more desirable, this option is turned on by default. @@ -855,7 +855,7 @@ =head1 YAML TERMINOLOGY -=begin orignal +=begin original YAML is a full featured data serialization language, and thus has its own terminology. @@ -865,7 +865,7 @@ YAML は完全な機能を持ったデータ直列化言語であり、 従って独自の専門用語を持ちます。 -=begin orignal +=begin original It is important to remember that although YAML is heavily influenced by Perl and Python, it is a language in it's own right, not merely just a @@ -876,7 +876,7 @@ 覚えておくべきことは、YAML は Perl と Python の影響を強く受けてはいますが、 独自の言語であり、単なる Perl 構造体の表現方法ではないということです。 -=begin orignal +=begin original YAML has three constructs that are conspicuously similar to Perl's hash, array, and scalar. They are called mapping, sequence, and string @@ -1063,7 +1063,7 @@ =head1 ysh - The YAML Shell -=begin orignal +=begin original The YAML distribution ships with a script called 'ysh', the YAML shell. ysh provides a simple, interactive way to play with YAML. If you type in @@ -1077,7 +1077,7 @@ Perl のコードを入力として与えると、YAML として結果を表示します。 YAML を入力すると、Perl のコードを表示します。 -=begin orignal +=begin original To run ysh, (assuming you installed it along with YAML.pm) simply type: @@ -1088,7 +1088,7 @@ ysh [options] -=begin orignal +=begin original Please read L<ysh> for the full details. There are lots of options. @@ -1098,7 +1098,7 @@ =head1 BUGS & DEFICIENCIES -=begin orignal +=begin original If you find a bug in YAML, please try to recreate it in the YAML Shell with logging turned on ('ysh -L'). When you have successfully reproduced @@ -1111,7 +1111,7 @@ バグの再現に成功したら、LOG ファイルを作者 (ingy****@cpan*****) に メールしてください。 -=begin orignal +=begin original WARNING: This is *ALPHA* code. @@ -1119,7 +1119,7 @@ 警告: これは「アルファ」コードです。 -=begin orignal +=begin original BIGGER WARNING: This is *TRIAL1* of the YAML 1.0 specification. The YAML syntax may change before it is finalized. Based on past experience, it @@ -1142,7 +1142,7 @@ =item Circular Leaves -=begin orignal +=begin original YAML is quite capable of serializing circular references. And for the most part it can deserialize them correctly too. One notable exception @@ -1159,7 +1159,7 @@ $foo = \$foo; -=begin orignal +=begin original This serializes fine, but I can't parse it correctly yet. Unfortunately, every wiseguy programmer in the world seems to try this first when you @@ -1176,7 +1176,7 @@ そんなわけで、この問題を解決する pure Perl のパッチを作ったので ない限り、どうかこのバグは報告しないでください。 -=begin orignal +=begin original By the way, similar non-leaf structures Dump and Load just fine: @@ -1186,7 +1186,7 @@ $foo->[0] = $foo; -=begin orignal +=begin original You can test these examples using 'ysh -r'. This option makes sure that the example can be deserialized after it is serialized. We call that @@ -1201,7 +1201,7 @@ =item Unicode -=begin orignal +=begin original Unicode is not yet supported. The YAML specification dictates that all strings be unicode, but this early implementation just uses ASCII. @@ -1214,7 +1214,7 @@ =item Structured Keys -=begin orignal +=begin original Python, Java and perhaps others support using any data type as the key to a hash. YAML also supports this. Perl5 only uses strings as @@ -1226,7 +1226,7 @@ どんなデータ型でも使えます。YAML もこれに対応しています。 Perl5 はハッシュキーとして文字列だけが使えます。 -=begin orignal +=begin original YAML.pm can currently parse structured keys, but their meaning gets lost when they are loaded into a Perl hash. Consider this example using the @@ -1248,7 +1248,7 @@ }; ysh > -=begin orignal +=begin original YAML.pm will need to be fixed to preserve these keys somehow. Why? Because if YAML.pm gets a YAML document from YAML.py it must be able to @@ -1262,7 +1262,7 @@ =item Globs, Subroutines, Regexes and File Handles -=begin orignal +=begin original As far as I know, other Perl serialization modules are not capable of serializing and deserializing typeglobs, subroutines (code refs), @@ -1277,7 +1277,7 @@ YAML.pm はこれら全てをダンプする能力があります。 これらを読み込むとおかしなことになるかもしれません。注意してください。 -=begin orignal +=begin original NOTE: For a (huge) dump of Perl's global guts, try: @@ -1288,7 +1288,7 @@ perl -MYAML -e '$YAML::UseCode=1; print Dump \%main::' -=begin orignal +=begin original To limit this to a single namespace try: @@ -1300,7 +1300,7 @@ =item Speed -=begin orignal +=begin original This is a pure Perl implementation that has been optimized for programmer readability, not for computational speed. @@ -1323,7 +1323,7 @@ =item Streaming Access -=begin orignal +=begin original This module Dumps and Loads in one operation. There is no interface for parsing or emitting a YAML stream one node at a time. It's all @@ -1335,7 +1335,7 @@ YAML ストリームを 1 ノードずつパースやエミットするインターフェースは ありません。"all or nothing"です。 -=begin orignal +=begin original An upcoming release will have support for incremental parsing. Incremental dumping is harder. Stay tuned. @@ -1349,7 +1349,7 @@ =head1 RESOURCES -=begin orignal +=begin original Please read L<YAML::Node> for advanced YAML features. @@ -1379,7 +1379,7 @@ =head1 IMPLEMENTATIONS -=begin orignal +=begin original This is the first implementation of YAML functionality based on the 1.0 specification. @@ -1388,7 +1388,7 @@ これは YAML 1.0 仕様を基にした機能の最初の実装です。 -=begin orignal +=begin original The following people have shown an interest in doing implementations. Please contact them if you are also interested in writing an