in reply to How do I reverse array elements?
Of course, most of the time, reverse is adequate and correct; but the following gives you more control when you need it.
sub rev { my @r; push @r, pop @_ while @_; @r }
In Section
Seekers of Perl Wisdom
in reply to How do I reverse array elements?
Of course, most of the time, reverse is adequate and correct; but the following gives you more control when you need it.
sub rev { my @r; push @r, pop @_ while @_; @r }