Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: For Loops and Reversing output

by ikegami (Pope)
on Dec 13, 2006 at 06:31 UTC ( #589496=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @reversed = reverse @sorted;
    for my $i (0..$#reversed) {
       print $reversed[$i], "\n";
    }
    
  2. or download this
    for (my $i=$#sorted; $i>=0; $i--) {
       print $sorted[$i], "\n";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2018-11-16 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (192 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!