… | |
… | |
341 | |
341 | |
342 | The C<TO_JSON> method may safely call die if it wants. If C<TO_JSON> |
342 | The C<TO_JSON> method may safely call die if it wants. If C<TO_JSON> |
343 | returns other blessed objects, those will be handled in the same |
343 | returns other blessed objects, those will be handled in the same |
344 | way. C<TO_JSON> must take care of not causing an endless recursion cycle |
344 | way. C<TO_JSON> must take care of not causing an endless recursion cycle |
345 | (== crash) in this case. The name of C<TO_JSON> was chosen because other |
345 | (== crash) in this case. The name of C<TO_JSON> was chosen because other |
346 | methods called by the Perl core (== not the user of the object) are |
346 | methods called by the Perl core (== not by the user of the object) are |
347 | usually in upper case letters and to avoid collisions with the C<to_json> |
347 | usually in upper case letters and to avoid collisions with the C<to_json> |
348 | function. |
348 | function. |
349 | |
349 | |
350 | This setting does not yet influence C<decode> in any way, but in the |
350 | This setting does not yet influence C<decode> in any way, but in the |
351 | future, global hooks might get installed that influence C<decode> and are |
351 | future, global hooks might get installed that influence C<decode> and are |