Maybe it's me, but your question is a bit confusing. Are you saying that $some_number would be the hash key that you want to get a random element from? As in, given $some_number = 20 you want to randomly get either "george" or "jane" or "elroy"?
You can certainly index into your HoA without line 6.
my $foo = $hoa{20}[1]; # assigns "jane" to $foo
In reply to Re: Get random element from HoA
by KurtSchwind
in thread Get random element from HoA
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |