in reply to Convert JS array of objects into Perl array of Hashes
This is not exactly valid JSON for JSON::XS. Quotes are either missing or single quotes.
A bit of toying reveals:
Anyone know how to make JSON::XS more tolerant?echo "[{feedId:6161,feedType:'forum'},{feedId:1469,feedType:'category' +}]" | perl -MData::Dump=dd -MJSON::XS -ne 's{(\w+):}{"$1":}g; s{@{[ch +r 39]}}{"}g;dd decode_json($_)' [ { feedId => 6161, feedType => "forum" }, { feedId => 1469, feedType => "category" }, ]
print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Convert JS array of objects into Perl array of Hashes
by afoken (Chancellor) on Dec 09, 2009 at 01:25 UTC |