Interesting

Perl Array Reverse() Function: Quick Tutorial

Perl Array Reverse() Function: Quick Tutorial

Perl's reverse() function is used to reverse the order of an array. The function returns a reversed array but does not reverse the array.

@REVERSED_LIST = reverse(@ARRAY);

reverse()returns @myNames = ('Jacob', 'Michael', 'Ethan', 'Andrew');

@reversedNames = reverse(@myNames);

@myNamesreverse()@[email protected]@reversedNames('Andrew', 'Ethan', 'Michael', 'Jacob')

, and @myNames remains the same.