while (my ($item) = splice(@array, 0, 1)) { print "$item\n"; }