in reply to Re: Parsing Array of arrays from json file
in thread Parsing Array of arrays from json file

Thank you. This is a good point. However, the script does not loop correctly through @records (only first element is printout)

  • Comment on Re^2: Parsing Array of arrays from json file

Replies are listed 'Best First'.
Re^3: Parsing Array of arrays from json file
by 1nickt (Canon) on Sep 12, 2021 at 10:38 UTC

    Since the structure is one level deeper than you thought, you need to add another loop. Try this:

    my @categories = $decoded_json[0]; foreach my $category (@categories){ foreach my $record (@$category) { print Dumper $record; print "Translation for $record->[0] is $record->[1 +]\n"; } }

    Hope this helps!


    The way forward always starts with a minimal test.