http://www.perlmonks.org?node_id=1134703


in reply to Re: Problem printing JSON type output
in thread Problem printing JSON type output

Close. Your code gives me the following:

{ "data": [ { "{#BOBINSTANCE}":"bob311"} { "{#BOBINSTANCE}":"bob411"} { "{#BOBINSTANCE}":"bob312"} { "{#BOBINSTANCE}":"bob412"} { "{#BOBINSTANCE}":"bob313"} { "{#BOBINSTANCE}":"bob413"} { "{#BOBINSTANCE}":"bob314"} { "{#BOBINSTANCE}":"bob414"} { "{#BOBINSTANCE}":"bob315"} { "{#BOBINSTANCE}":"bob415"} { "{#BOBINSTANCE}":"bob331"} { "{#BOBINSTANCE}":"bob332"} { "{#BOBINSTANCE}":"bob431"} { "{#BOBINSTANCE}":"bob432"} { "{#BOBINSTANCE}":"bob333"} { "{#BOBINSTANCE}":"bob334"} { "{#BOBINSTANCE}":"bob433"} { "{#BOBINSTANCE}":"bob434"} { "{#BOBINSTANCE}":"bob341"} { "{#BOBINSTANCE}":"bob342"} { "{#BOBINSTANCE}":"bob343"} { "{#BOBINSTANCE}":"bob351"} { "{#BOBINSTANCE}":"bob352"} { "{#BOBINSTANCE}":"bob353"} { "{#BOBINSTANCE}":"bob361"} { "{#BOBINSTANCE}":"bob362"} { "{#BOBINSTANCE}":"bob363"} { "{#BOBINSTANCE}":"bob371"} { "{#BOBINSTANCE}":"bob372"} { "{#BOBINSTANCE}":"bob373"} { "{#BOBINSTANCE}":"bob441"} { "{#BOBINSTANCE}":"bob442"} { "{#BOBINSTANCE}":"bob443"} { "{#BOBINSTANCE}":"bob451"} { "{#BOBINSTANCE}":"bob452"} { "{#BOBINSTANCE}":"bob453"} { "{#BOBINSTANCE}":"bob461"} { "{#BOBINSTANCE}":"bob462"} { "{#BOBINSTANCE}":"bob463"} { "{#BOBINSTANCE}":"bob471"} { "{#BOBINSTANCE}":"bob472"} { "{#BOBINSTANCE}":"bob473"} ] }
It needs to be:
{ "data": [ { "{#BOBINSTANCE}":"bob311"}, { "{#BOBINSTANCE}":"bob411"}, { "{#BOBINSTANCE}":"bob312"}, { "{#BOBINSTANCE}":"bob412"}, { "{#BOBINSTANCE}":"bob313"}, { "{#BOBINSTANCE}":"bob413"}, { "{#BOBINSTANCE}":"bob314"}, { "{#BOBINSTANCE}":"bob414"}, { "{#BOBINSTANCE}":"bob315"}, { "{#BOBINSTANCE}":"bob415"}, { "{#BOBINSTANCE}":"bob331"}, { "{#BOBINSTANCE}":"bob332"}, { "{#BOBINSTANCE}":"bob431"}, { "{#BOBINSTANCE}":"bob432"}, { "{#BOBINSTANCE}":"bob333"}, { "{#BOBINSTANCE}":"bob334"}, { "{#BOBINSTANCE}":"bob433"}, { "{#BOBINSTANCE}":"bob434"}, { "{#BOBINSTANCE}":"bob341"}, { "{#BOBINSTANCE}":"bob342"}, { "{#BOBINSTANCE}":"bob343"}, { "{#BOBINSTANCE}":"bob351"}, { "{#BOBINSTANCE}":"bob352"}, { "{#BOBINSTANCE}":"bob353"}, { "{#BOBINSTANCE}":"bob361"}, { "{#BOBINSTANCE}":"bob362"}, { "{#BOBINSTANCE}":"bob363"}, { "{#BOBINSTANCE}":"bob371"}, { "{#BOBINSTANCE}":"bob372"}, { "{#BOBINSTANCE}":"bob373"}, { "{#BOBINSTANCE}":"bob441"}, { "{#BOBINSTANCE}":"bob442"}, { "{#BOBINSTANCE}":"bob443"}, { "{#BOBINSTANCE}":"bob451"}, { "{#BOBINSTANCE}":"bob452"}, { "{#BOBINSTANCE}":"bob453"}, { "{#BOBINSTANCE}":"bob461"}, { "{#BOBINSTANCE}":"bob462"}, { "{#BOBINSTANCE}":"bob463"}, { "{#BOBINSTANCE}":"bob471"}, { "{#BOBINSTANCE}":"bob472"}, { "{#BOBINSTANCE}":"bob473"} ] }