cshavit has asked for the wisdom of the Perl Monks concerning the following question:
Consider this code snippet:
use JSON::XS; # # # my $json = "{\"has_more\": true}"; my $d = decode_json($json); my $e = encode_json($d);
You'd expect $e to equal $json. And if you ran it from a shell, it would be true.
I have two apache virtual hosts, running by the same Apache server on Ubunto. One of the servers always runs the code correctly. The other always dies on encode_json() with
"encountered object '1', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing)"The problem does not happen if I use JSON::PP.
Could you please help me with fixing it? Even a hint.
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: JSON::XS and blessings
by toolic (Bishop) on Oct 13, 2015 at 19:50 UTC | |
by cshavit (Novice) on Oct 13, 2015 at 19:57 UTC | |
by Your Mother (Archbishop) on Oct 13, 2015 at 20:06 UTC | |
by cshavit (Novice) on Oct 13, 2015 at 20:30 UTC | |
by tye (Sage) on Oct 13, 2015 at 22:26 UTC | |
by toolic (Bishop) on Oct 14, 2015 at 14:59 UTC | |
by cshavit (Novice) on Oct 14, 2015 at 16:41 UTC | |
by Your Mother (Archbishop) on Oct 14, 2015 at 17:31 UTC | |
| |
|
Re: JSON::XS and blessings
by Anonymous Monk on Oct 16, 2015 at 08:03 UTC |