foreach my $row (@rows) { ... } #### for my $i (0 .. $#rows) { ... # something with $rows[$i] }