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.
In reply to Re^3: Formatting JSON the right way
by hippo
in thread Formatting JSON the right way
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |