foreach $i (0 .. $#array) { # do something with $array[$i] }