in reply to Re^2: Formatting JSON the right way
in thread Formatting JSON the right way
Sure, try this:
my $returned_data = $data_handle->fetchall_arrayref ({}); # Any other ops here, and then: print $q->header(-type => "application/json", -charset => "utf-8"); my $json = encode_json ($returned_data); print $json;
Untested (especially with ODBC which I almost never use) but hopefully you get the gist. See DBI for the details of fetchall_arrayref.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Formatting JSON the right way
by Anonymous Monk on Aug 20, 2014 at 13:10 UTC | |
by scorpio17 (Canon) on Aug 20, 2014 at 15:30 UTC |