DavidSzczesniak
1/3/2018 - 10:04 AM

The Reverse Operator

Takes a list of values, and returns the list in the opposite order.

@fred = 6..10;
@barney = reverse(@fred); # gets 10, 9, 8, 7, 6
@wilma = reverse 6..10; # same thing, without using the other array
@fred = reverse @fred; # puts the result back into the original array

\!h # Note: reverse returns the reversed list; it's useless without the return value
reverse @fred; # is WRONG