--- JSON-XS/XS.pm 2007/11/28 13:57:15 1.74 +++ JSON-XS/XS.pm 2007/12/04 10:37:42 1.77 @@ -21,12 +21,28 @@ $pretty_printed_unencoded = $coder->encode ($perl_scalar); $perl_scalar = $coder->decode ($unicode_json_text); + # Note that JSON version 2.0 and above will automatically use JSON::XS + # if available, at virtually no speed overhead either, so you should + # be able to just: + + use JSON; + + # and do the same things, except that you have a pure-perl fallback now. + =head1 DESCRIPTION This module converts Perl data structures to JSON and vice versa. Its primary goal is to be I and its secondary goal is to be I. To reach the latter goal it was written in C. +Beginning with version 2.0 of the JSON module, when both JSON and +JSON::XS are installed, then JSON will fall back on JSON::XS (this can be +overriden) with no overhead due to emulation (by inheritign constructor +and methods). If JSON::XS is not available, it will fall back to the +compatible JSON::PP module as backend, so using JSON instead of JSON::XS +gives you a portable JSON API that can be fast when you need and doesn't +require a C compiler when that is a problem. + As this is the n-th-something JSON module on CPAN, what was the reason to write yet another JSON module? While it seems there are many JSON modules, none of them correctly handle all corner cases, and in most cases @@ -429,13 +445,13 @@ =item $json = $json->allow_blessed ([$enable]) -=item $enabled = $json->get_allow_bless +=item $enabled = $json->get_allow_blessed If C<$enable> is true (or missing), then the C method will not barf when it encounters a blessed reference. Instead, the value of the B option will decide whether C (C -disabled or no C method found) or a representation of the -object (C enabled and C method found) is being +disabled or no C method found) or a representation of the +object (C enabled and C method found) is being encoded. Has no effect on C. If C<$enable> is false (the default), then C will throw an