in reply to How to encode/decode a class inside a class in JSON
See above: "haj" is right. In order to cause something to "behave as a Perl object," you must bless() it, and the JSON deserializer by-itself does not know how to do that (and cannot be expected to).