--- JSON-XS/XS.pm 2007/06/11 03:42:57 1.40 +++ JSON-XS/XS.pm 2007/06/11 03:45:26 1.41 @@ -616,20 +616,21 @@ however, a mass hysteria and very far from the truth. In general, there is no way to configure JSON::XS to output a data structure as valid YAML. -If you really must use JSON::XS to generate YAML, you should this +If you really must use JSON::XS to generate YAML, you should use this algorithm (subject to change in future versions): my $to_yaml = JSON::XS->new->utf8->space_after (1); my $yaml = $to_yaml->encode ($ref) . "\n"; This will usually generate JSON texts that also parse as valid -YAML. Please note that YAML has hardcoded limits on object key lengths -that JSON doesn't have, so you should make sure that your hash keys are -noticably shorter than 1024 characters. +YAML. Please note that YAML has hardcoded limits on (simple) object key +lengths that JSON doesn't have, so you should make sure that your hash +keys are noticably shorter than the 1024 characters YAML allows. There might be other incompatibilities that I am not aware of. In general you should not try to generate YAML with a JSON generator or vice versa, -or try to parse JSON with a YAML parser or vice versa. +or try to parse JSON with a YAML parser or vice versa: chances are high +that you will run into severe interoperability problems. =head2 SPEED