Is there a way to encode object constructors with the JSON Perl Module? -
all,
i'm using json perl module encode json.
i'd resulting json include lines this:
{ "startdate": new date(2010,11,15,0,0), "astring" : "string data", "anumber" : 1234 }
in order create that, have perl hashref this:
{ startdate => see below, astring => "string data", anumber => 1234, }
here's problem: can't figure out how coerce json module printing unquoted strings, can include new date(...)
instantiation call. i've tried creating perl module to_json method, output still gets quoted.
does out there have suggestions on how can encourage json print unquoted strings?
json not meant encode objects that. encodes simple data structures arrays , hashes. if want use deserialized data populate blessed object, need add layer on top.
for moose objects, plugin moosex::storage built expressly purpose.
Comments
Post a Comment