Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: First Value in hash (List::Util::minstr())

by lodin (Hermit)
on Jan 08, 2008 at 11:18 UTC ( [id://661057]=note: print w/replies, xml ) Need Help??


in reply to First Value in hash

Instead of sorting the keys, which is unnecessary work, you can use List::Util's minstr subroutine.

use List::Util 'minstr'; my $first_key = minstr(keys %in);

lodin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found