… | |
… | |
748 | C<incr_skip> to skip the erroneous part). This is the most common way of |
748 | C<incr_skip> to skip the erroneous part). This is the most common way of |
749 | using the method. |
749 | using the method. |
750 | |
750 | |
751 | And finally, in list context, it will try to extract as many objects |
751 | And finally, in list context, it will try to extract as many objects |
752 | from the stream as it can find and return them, or the empty list |
752 | from the stream as it can find and return them, or the empty list |
753 | otherwise. For this to work, there must be no separators between the JSON |
753 | otherwise. For this to work, there must be no separators (other than |
754 | objects or arrays, instead they must be concatenated back-to-back. If |
754 | whitespace) between the JSON objects or arrays, instead they must be |
755 | an error occurs, an exception will be raised as in the scalar context |
755 | concatenated back-to-back. If an error occurs, an exception will be |
756 | case. Note that in this case, any previously-parsed JSON texts will be |
756 | raised as in the scalar context case. Note that in this case, any |
757 | lost. |
757 | previously-parsed JSON texts will be lost. |
758 | |
758 | |
759 | Example: Parse some JSON arrays/objects in a given string and return |
759 | Example: Parse some JSON arrays/objects in a given string and return |
760 | them. |
760 | them. |
761 | |
761 | |
762 | my @objs = JSON::XS->new->incr_parse ("[5][7][1,2]"); |
762 | my @objs = JSON::XS->new->incr_parse ("[5][7][1,2]"); |