for (my $i = 0, $i < $#arr, $i++) { #corrections ^ ^^ ^ #strictly speaking, the commas instead of semis are merely my preferences do something...; }