Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: Convert JS array of objects into Perl array of Hashesby afoken (Chancellor) |
on Dec 09, 2009 at 01:25 UTC ( [id://811846]=note: print w/replies, xml ) | Need Help?? |
Anyone know how to make JSON::XS more tolerant? JSON::XS has a "relaxed" mode (F_RELAXED in the XS code). Currently, it allows:
This looks like a proper way to allow unquoted keys and the like, you "just" have to modify the XS code. The one thing that really drives me mad is the shell-style comment. Why on earth would someone want shell comments in JSON? JSON is derived from Javascript, and it is designed to be evaluateable by current browsers. Javascript has inherited its comment syntax from C and C++, i.e. // for single line comments and /* */ for comment blocks. I would like to see those comments supported by JSON::XS. No browser understands shell comments, so they should be removed. A different approach could be a subclass that uses the incremental parsing feature. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|