Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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?
[GotToBTru]: back atcha thezip

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2016-12-05 21:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (94 votes). Check out past polls.