[Q&A Editor- Changed "scalar %h" to "scalar keys %h" as noted by chipmunk.]$lh=(split "/",scalar keys %h)[0]; print ((keys %h)[int rand($lh)]);
Originally posted as a Categorized Answer.
In reply to Re: How do I select a random key from a hash?
by arhuman
in thread How do I select a random key from a hash?
by tadman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |