for(@Keys){ $hash{ $Keys[$j++] } = $valueX[$k++]; } $j= 0; $k = 0; push @AoH, \%hash; #$AoH[($i)-1] = \%hash; }