in reply to Get hash values in multidimensional array to populate Term document matrix

Your dereferencing is much easier if your outer loop loops through the array rather than the indexes and the inner loop uses the function 'each' to get extract both key and value.
use strict; use warnings; my @arr = ([ {key=>12, pl=>1, lop=>9}, {key=>12, pl=>1, lo =>9}, ]); foreach my $subArr_ref (@arr) { foreach my $hash_ref (@$subArr_ref) { while (my ($key, $value) = each %$hash_ref) { print "$key: $value\n"; } } } OUTPUT: pl: 1 lop: 9 key: 12 lo: 0 key: 12 pl: 1
Bill