@array = (1..9); while (@array){ print +(pop @array), "\n"; }
If you really need that element for something along with the print, you can do this:
@array = (1..9); while (@array){ my $last = pop @array; do_something($last); print "$last\n"; }
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re: $#array issue
by QM
in thread $#array issue
by biohisham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |