in reply to $#array issue

Lot's of good answers. Maybe this is short and sweet?
@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