for (my $i = 0; $i < 3; $i++) { # array has 3 elements foreach my $key (keys @{$AoH[$i]}) { # DO STH } } #### @AoH = ( { a => "a1", b => "b1", c => "c1", }, { d => "d1", e => "e1", f => "f1", }, { g => "g1", h => "h1", i => "i1", }, );