in reply to reading array from the last into begining

Q: How do I iterate over an array in reverse order:
foreach my $element ( reverse @array ) { print "$element\n"; }
Q: How do I sort an array in reverse order (descending instead of ascending):
@sorted_array = reverse sort @array;
or
@sorted_array = sort { $b <=> $a } @array;
(That's for numeric values. For strings try....)
@sorted_array = sort { $b cmp $a } @array;
Hmm.... a few others with map and unshift:
@reversed_array = map { $array[$_] } reverse 0..$#array;
or....
foreach $element ( @array ) { unshift @reversed_array, $element; }

Have at it!


Dave


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein