for ($i=0; $i<=10; $i++) # old faithful! for (0..10) for (@array) for (0..$#array) print $_ for 0..10 print $_ for @array print $array[$_] for 0..$#array print $i++ while $i<10 Not to mention foreach (same as for but...) foreach my $element (@array) map {print} 0..10 Throw in a few infinite loop constructs for (;;) 1 while while (1) #### sub getArrayIndex { map{return --$_ if $_[0] eq $_[$_]}(1..@_-1) and -1 }