When I use this I keep thinking that there has to be a better way to do this without an intermediate array, but I could not find anything in the docs or the Cookbook that addressed this.#assuming we have %knockknocks populated with many knock knock jokes my @setups = keys %knockknocks; my $jokekey = $setups[rand @setups];
In reply to easy way to get random key from hash? by moof1138
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |