All,
I'm using the JSON Perl module to encode JSON.
I'd like the resulting JSON to include lines like this:
{
"startDate": new Date(2010,11,15,0,0),
"aString" : "String Data",
"aNumber" : 1234
}
In order to create that, I have a Perl HASHREF like this:
{
startDate => SEE BELOW,
aString => "String Data",
aNumber => 1234,
}
Here's my problem: I can't figure out how to coerce the JSON module into printing unquoted strings, so that I can include my new Date(...)
instantiation call. I've tried creating a Perl module with a TO_JSON method, but the output still gets quoted.
Does anybody out there have any suggestions on how I can encourage JSON to print unquoted strings?