foreach (@rows) { push(@arr,{}); $cnt++; # .... code ... $arr[$cnt]{somestring}=$somevalue; }