Logo

Programming-Idioms

History of Idiom 19 > diff from v2 to v3

Edit summary for version 3 by :

Version 2

2015-07-10, 08:01:58

Version 3

2015-07-31, 19:13:33

Idiom #19 Reverse a list

Reverse the order of the elements of list x .
This may reverse "in-place" and destroy the original ordering.

Idiom #19 Reverse a list

Reverse the order of the elements of list x .
This may reverse "in-place" and destroy the original ordering.

Code
my @list = ('words', 'of', 'list', 'a', 'reverse');
my @reversed = reverse @list;
Comments bubble
reverse is a built-in function. Given an array, it will reverse it. Given a string, it will return a string with the letters reversed.