my @array = (1 .. 9); while (@array) { my $last = pop @array; print "$last\n"; }