in reply to reading JSON
Try enclosing the whole structure into an array ref, and don't forget commas!
[ { "_id" : 0, "name" : "Betty Boop", "subjects" : [ { "type" : "optional", "subject" : "Voice"}, { "type" : "required", "subject" : "Math" }, { "type" : "required", "subject" : "English" } ] }, { "_id" : 1, "name" : "Donald Duck", "subjects" : [ { "type" : "optional", "subject" : "Accounting" }, { "type" : "required", "subject" : "Math" }, { "type" : "required", "subject" : "English" } ] } ]
By the way, here is a utility i use to help debug JSON files:
alias djson='perl -MData::Dumper -MJSON -MFile::Slurp -e"print Dumper +decode_json read_file shift"'
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reading JSON
by marinersk (Priest) on Jun 16, 2015 at 19:28 UTC |