in reply to Re: Array of hashes?
in thread Array of hashes?
Thank you. I read the json data like this (verbose here):
my $data = decode_json( $json ); my $definition= $data->{'myData'}; my @definition=@$definition; print Dumper \@definition; #trying to access the data structure with: foreach my $record (@definition) { print $record->{Lang4}; }
The json data is produced like this (according to documentation). I could access/change the script originating the json file, if needed:
while (my $row = $sth->fetchrow_hashref) { push @definition, $row; } print objToJson( { myData => \@definition} );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Array of hashes?
by haukex (Archbishop) on Jan 04, 2021 at 17:49 UTC | |
by Anonymous Monk on Jan 04, 2021 at 19:08 UTC |