my $choice = do {@_ = (); @_ = (@_, map{ ($_->[0]) x $_->[1] } [$a,$b]) while ($a,$b)= each %hash; $_[rand @_]};