I have this example:
my $numbers = [ 1, 2, 3, 4, 5, 6 ];
my $newarray = [ reverse @$numbers ];
This example contains some synthetic code to make the $numbers
arrayref appropriate for the reverse
function. I would like to remove that code and do something more like this:
my $newarray = reverse $numbers;
I know this doesn't work, it returns:
)8936f22x0(YARRA
Is there a better way to reverse an arrayref in Perl without changing the first line?
UPDATE:
my $mails = [ reverse @{$mail_api->GetLogSendMail({ customer_id => $id })} ];
The idea is to make the above line of code better.