Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: For Loops and Reversing output

by liverpole (Monsignor)
on Dec 12, 2006 at 00:42 UTC ( #589201=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @sorted = sort @unsorted;
    
  2. or download this
    my @sorted = sort { $b cmp $a } @unsorted;
    
  3. or download this
    my $nextitem;
    while ($nextitem = pop @rocks) {
        # Use $nextitem
    }
    
  4. or download this
    for (my $i=1; $i <= @rocks; $i++) {
        my $nextitem = $rocks[- $i];    # Take the ${i}th item from the en
    +d
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2014-09-03 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls