We are searching data for your request:
Upon completion, a link will appear to access the found materials.
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.