my @list = 1..10; my @odd = grep { $_ % 2 } @list; # Now you can work on the elements of @odd one element at a time, by removing them as you use them if you want.