--- JSON-XS/XS.pm 2008/03/26 01:43:14 1.97 +++ JSON-XS/XS.pm 2008/03/30 09:27:16 1.100 @@ -105,7 +105,7 @@ use strict; -our $VERSION = '2.1'; +our $VERSION = '2.2'; our @ISA = qw(Exporter); our @EXPORT = qw(encode_json decode_json to_json from_json); @@ -465,6 +465,22 @@ JSON::XS->new->allow_nonref->encode ("Hello, World!") => "Hello, World!" +=item $json = $json->allow_unknown ([$enable]) + +=item $enabled = $json->get_allow_unknown + +If C<$enable> is true (or missing), then C will I throw an +exception when it encounters values it cannot represent in JSON (for +example, filehandles) but instead will encode a JSON C value. Note +that blessed objects are not included here and are handled separately by +c. + +If C<$enable> is false (the default), then C will throw an +exception when it encounters anything it cannot encode as JSON. + +This option does not affect C in any way, and it is recommended to +leave it off unless you know your communications partner. + =item $json = $json->allow_blessed ([$enable]) =item $enabled = $json->get_allow_blessed @@ -685,7 +701,7 @@ =head1 INCREMENTAL PARSING -[This section is still EXPERIMENTAL] +[This section and the API it details is still EXPERIMENTAL] In some cases, there is the need for incremental parsing of JSON texts. While this module always has to keep both JSON text and resulting @@ -1216,8 +1232,9 @@ a very short single-line JSON string (also available at L). - {"method": "handleMessage", "params": ["user1", "we were just talking"], \ - "id": null, "array":[1,11,234,-5,1e5,1e7, true, false]} + {"method": "handleMessage", "params": ["user1", + "we were just talking"], "id": null, "array":[1,11,234,-5,1e5,1e7, + true, false]} It shows the number of encodes/decodes per second (JSON::XS uses the functional interface, while JSON::XS/2 uses the OO interface