in reply to Push and list context
It's hard to say what better/more elegant would be in the absence of some context. That said, if all I wanted to do was to print an array forwards and backwards, with spaces between the elements, I'd just do something like
If you need to keep the reverse array, thenmy @array = qw(one two three); print "@{[@array, reverse @array]}\n";
my @yarra = reverse my @array = qw(one two three); print "@array @yarra\n";
the lowliest monk
|
|---|