"How to convert Perl objects into JSON and vice versa"接受的答案说转换是毛茸茸的。
有没有人真正使用JSON反序列化嵌套的祝福对象?怎么样?
答案 0 :(得分:0)
使用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"}}}}