in reply to $#array issue

$#array is the index of the last element. pop shortens the array. In your condition, you have
$index < $#array + 1
while in your body, you both increase $index and decrease $#array. So, after printing 5, $index is no longer less than $#array + 1, and hence the loop terminates.

Why not

my @array = (1 .. 9); while (@array) { my $last = pop @array; print "$last\n"; }
Or some alternatives:
my @array = reverse (1 .. 9); print "$_\n" for @array; my @array = (1 .. 9); my $index = $#array; while ($index >= 0) { print $array[$index], "\n"; $index--; } my @array = (1 .. 9); for (my $index = $#array; $index >=0; $index--) { print $array[$index], "\n"; }