Hi Alexander, That works !! Thanks Alvaro |----------------------------------------------------------------------------------------| Stay safe / Cuídate/ Reste sécurisé *7* Switch off as you go / Apaga lo que no usas / Débranchez au fur et à mesure. *q *Recycle always / Recicla siempre / Recyclez toujours P Print only if absolutely necessary / Imprime solo si es necesario / Imprimez seulement si nécessaire Le mer. 8 juil. 2020 à 01:53, Alexander Borkowski < Alexander.Borkowski@kau.se> a écrit :
Hi Alvaro,
The JSON data you are seeing in the browser is an array (of arrays) not a JSON object. Accordingly, $json_obj is a reference to an Perl array not a Perl hash. Hence the output
JSON OBJ: ARRAY(0x564ec76dd7f8)
and Perl's complaint about $json_obj being treated as hash reference:
Not a HASH reference at reporte53-2.pl line 23.
The same goes for $row, too. It is also an array reference. Try to change the end of your script to this:
print "JSON OBJ: " . $json_obj . "\n"; print scalar(@{$json_obj}), " rows:\n";
foreach my $row (@{$json_obj}){ print join(" ", @{$row}), "\n"; }
Hope this helps,
Alexander
_______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha