Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Answer: How do I reverse array elements?

by superfrink (Curate)
on Mar 11, 2006 at 05:17 UTC ( #535877=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > How do I reverse array elements? - Answer contributed by superfrink

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 }

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-12-14 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (414 votes). Check out past polls.

    Notices?