Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: selecting random key from hash

by rrwo (Friar)
on Jul 13, 2004 at 21:45 UTC ( [id://374152]=note: print w/replies, xml ) Need Help??


in reply to selecting random key from hash

Why do you need a random key from the hash? How many do you need?

The order of hash keys is for all intents and purposes "random" (unordered, with a security randomization added in Perl 5.8.1 I think), so for some purposes you can just take the first n hash keys...

For some purposes, this is good enough.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2025-01-18 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (56 votes). Check out past polls.