while (my $value=shift @array) while (my $value=pop @array) foreach my $value (@array) # this might be the slowest for (my $i=0;$i<=@array;$i++) { my $value=$array[$i]; }