my $count = 10; while ($count) { #do something to array print $array[$count--]; } # alternative $count =0; for (@array) { print "$count $_\n"; # $_ is the current array item $count = &something_complex; } #### my $count =0; while(1) { # do something to the array $count = &something_strange last if (test_exit_condition); }