Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: For Loops and Reversing output

by Anonymous Monk
on Dec 12, 2006 at 09:07 UTC ( #589237=note: print w/replies, xml ) Need Help??


in reply to For Loops and Reversing output

Are you looking to print your array in reverse order. If thats the case its easy. just loop in the following way for (my $i=$#sorted; $i>0 ; $i--) { print $sorted $i, "\n"; } Hope this helps

Replies are listed 'Best First'.
Re^2: For Loops and Reversing output
by ikegami (Pope) on Dec 12, 2006 at 17:03 UTC
    That should be for (my $i=$#sorted; $i>=0; $i--) (>=0, not >0), and it's the first thing mentioned in the first reply.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2016-09-25 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (463 votes). Check out past polls.