for (my $i = 0; $i < @array; ++$i) { # do something with $array[$i] # do something with $i }