--- JSON-XS/README 2016/02/26 21:46:45 1.40 +++ JSON-XS/README 2017/08/17 03:47:54 1.42 @@ -38,7 +38,7 @@ 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. + it 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 @@ -678,10 +678,10 @@ And finally, in list context, it will try to extract as many objects from the stream as it can find and return them, or the empty list - otherwise. For this to work, there must be no separators between the - JSON objects or arrays, instead they must be concatenated - back-to-back. If an error occurs, an exception will be raised as in - the scalar context case. Note that in this case, any + otherwise. For this to work, there must be no separators (other than + whitespace) between the JSON objects or arrays, instead they must be + concatenated back-to-back. If an error occurs, an exception will be + raised as in the scalar context case. Note that in this case, any previously-parsed JSON texts will be lost. Example: Parse some JSON arrays/objects in a given string and return @@ -699,6 +699,10 @@ exception, you can also call this method before having parsed anything. + That means you can only use this function to look at or manipulate + text before or after complete JSON objects, not while the parser is + in the middle of parsing a JSON object. + This function is useful in two cases: a) finding the trailing text after a JSON object or b) parsing multiple JSON objects separated by non-JSON text (such as commas). @@ -1483,7 +1487,7 @@ INTEROPERABILITY WITH OTHER MODULES "JSON::XS" uses the Types::Serialiser module to provide boolean constants. That means that the JSON true and false values will be - comaptible to true and false values of iother modules that do the same, + comaptible to true and false values of other modules that do the same, such as JSON::PP and CBOR::XS. INTEROPERABILITY WITH OTHER JSON DECODERS @@ -1507,7 +1511,7 @@ invalid) JSON syntax for serialised objects, and you still want to decode the generated When you want to serialise objects, you can run a regex to replace the tagged syntax by standard JSON arrays (it only - works for "normal" packagesnames without comma, newlines or single + works for "normal" package names without comma, newlines or single colons). First, the readable Perl version: # if your FREEZE methods return no values, you need this replace first: @@ -1551,23 +1555,21 @@ both the original JSON specification on www.json.org and RFC4627. As far as I can see, you can get partial compatibility when parsing by - using "->allow_nonref". However, consider thew security implications of + using "->allow_nonref". However, consider the security implications of doing so. I haven't decided yet when to break compatibility with RFC4627 by default (and potentially leave applications insecure) and change the default to follow RFC7159, but application authors are well advised to call "->allow_nonref(0)" even if this is the current default, if they - cannot handle non-reference values, in preparation for the day when the4 + cannot handle non-reference values, in preparation for the day when the default will change. -THREADS - This module is *not* guaranteed to be thread safe and there are no plans - to change this until Perl gets thread support (as opposed to the - horribly slow so-called "threads" which are simply slow and bloated - process simulations - use fork, it's *much* faster, cheaper, better). - - (It might actually work, but you have been warned). +(I-)THREADS + This module is *not* guaranteed to be ithread (or MULTIPLICITY-) safe + and there are no plans to change this. Note that perl's builtin + so-called theeads/ithreads are officially deprecated and should not be + used. THE PERILS OF SETLOCALE Sometimes people avoid the Perl locale support and directly call the