use warnings; use strict; use diagnostics; my @arr = ('a'..'z'); print "@arr\n"; my @copy = @arr; while (@copy) #size of @copy is re-evaluated at each iteration { my $ele = pop @copy; print "$ele "; } print "\n"; __END__ Prints: a b c d e f g h i j k l m n o p q r s t u v w x y z z y x w v u t s r q p o n m l k j i h g f e d c b a