Your criteria are curious. You could do something like this:
That generates a list of all the keys each time you do it. (but it doesn't use an array! :-)$random_element = (keys %hash)[rand keys %hash];
In reply to Re: selecting random key from hash
by duff
in thread selecting random key from hash
by davidj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |