Well, that is the thing everyone is pointing out. You can either write a pre-parser that fixes it into standard JSON, then read it with the JSON modules, or parsing it yourself (which could mean you will have to implement much more).
From JSON#Data_portability_issues
Despite the widespread belief that JSON is a strict subset of JavaScript, this is not the case. Specifically, JSON allows the Unicode line terminators U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped in quoted strings, while JavaScript does not.
.
In "Unsupported native data types" Wikipedia specifically states for Date() that there are some de facto standards, e.g., converting from Date to String, but none universally recognized. This JSON is "weird" like that.
So each line is an identifier: thing
where thing can be:
(something that must be evaluated in Javascript itself)
"{"...."}" a hash
"a string"
false a boolean
new Date(... a date
Strings and booleans are json already, the others, not that much...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.