in reply to Json and blessed references
If you happen to use Moose, MooseX::Storage supports JSON serialization among others.
I believe the JSON output from object instances are simply a hash/dict with a key "__class__", which is what was previously suggested that you can manually do. The conversion from object to JSON and vice-versa is automatically and easily done for you by the module.
Of course, you can do other tricks as well such as rebuild an entire class tree to/from hashes via Moose's "coercion" features. More importantly, MooseX::Storage also gives you, flexible ways/levels to customize/give hints as to "how" you want your objects serialized/deserialized.
|
|---|