The accepted answer to "How to convert Perl objects into JSON and vice versa" says that the conversion is hairy.
Does anyone actually use JSON for deserialization of nested blessed objects? How?
The accepted answer to "How to convert Perl objects into JSON and vice versa" says that the conversion is hairy.
Does anyone actually use JSON for deserialization of nested blessed objects? How?
Use JSYNC.
perl -Moose=Foo -MJSYNC -e'
has "attr", is => "rw", isa => "HashRef[HashRef]", default => sub { { 0 => { 1 => { 3 => 4} } } };
print JSYNC::dump(Foo->new)
'
{"!":"!perl/hash:Foo","attr":{"0":{"1":{"3":"4"}}}}