for (my $i = 0; $i < @array; $i++) { my $item = $array[$i]; do_something_with($item, $i); }