- or download this
foreach my $element ( reverse @array ) {
print "$element\n";
}
- or download this
@sorted_array = reverse sort @array;
- or download this
@sorted_array = sort { $b <=> $a } @array;
- or download this
@sorted_array = sort { $b cmp $a } @array;
- or download this
@reversed_array = map { $array[$_] } reverse 0..$#array;
- or download this
foreach $element ( @array ) {
unshift @reversed_array, $element;
}