Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: printing largest hash value

by tomhukins (Curate)
on Feb 22, 2005 at 09:40 UTC ( [id://433299]=note: print w/replies, xml ) Need Help??


in reply to Re: printing largest hash value
in thread printing largest hash value

Avoid rearranging the elements in an array you've just sorted.

Instead of reverse sort { $b <=> $a } keys %hash, write sort { $a <=> $b } keys %hash. The second approach reads more clearly and runs more quickly.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (None)
    As of 2024-04-19 00:10 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found