… | |
… | |
714 | return without doing anything further. This can be used to add more text |
714 | return without doing anything further. This can be used to add more text |
715 | in as many chunks as you want. |
715 | in as many chunks as you want. |
716 | |
716 | |
717 | If the method is called in scalar context, then it will try to extract |
717 | If the method is called in scalar context, then it will try to extract |
718 | exactly I<one> JSON object. If that is successful, it will return this |
718 | exactly I<one> JSON object. If that is successful, it will return this |
719 | object, otherwise it will return C<undef>. This is the most common way of |
719 | object, otherwise it will return C<undef>. If there is a parse error, |
|
|
720 | this method will croak just as C<decode> would do (one can then use |
|
|
721 | C<incr_skip> to skip the errornous part). This is the most common way of |
720 | using the method. |
722 | using the method. |
721 | |
723 | |
722 | And finally, in list context, it will try to extract as many objects |
724 | And finally, in list context, it will try to extract as many objects |
723 | from the stream as it can find and return them, or the empty list |
725 | from the stream as it can find and return them, or the empty list |
724 | otherwise. For this to work, there must be no separators between the JSON |
726 | otherwise. For this to work, there must be no separators between the JSON |
725 | objects or arrays, instead they must be concatenated back-to-back. |
727 | objects or arrays, instead they must be concatenated back-to-back. If |
|
|
728 | an error occurs, an exception will be raised as in the scalar context |
|
|
729 | case. Note that in this case, any previously-parsed JSON texts will be |
|
|
730 | lost. |
|
|
731 | |
|
|
732 | If there is a parse |
726 | |
733 | |
727 | =item $lvalue_string = $json->incr_text |
734 | =item $lvalue_string = $json->incr_text |
728 | |
735 | |
729 | This method returns the currently stored JSON fragment as an lvalue, that |
736 | This method returns the currently stored JSON fragment as an lvalue, that |
730 | is, you can manipulate it. This I<only> works when a preceding call to |
737 | is, you can manipulate it. This I<only> works when a preceding call to |