Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 meditating upon the Monastery: (7)
As of 2017-08-24 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (364 votes). Check out past polls.

    Notices?