⭐ in reply to How do I select a random key from a hash?
[Q&A Editor- Changed '(split "/",scalar %h)[0]' to "scalar keys %h" as noted by chipmunk.]$lh=scalar keys %h; print ((keys %h)[int rand($lh)]);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How do I select a random key from a hash?
by chipmunk (Parson) on Feb 05, 2001 at 22:01 UTC |