my $item; while (defined($item = shift @array)){ print $item, "\n"; }