my $choice = do {@_ = (); @_ = (@_, map{ ($_->[0]) x $_->[1] } [$a,$b]) while ($a,$b)= each %hash; $_[rand @_]}; #### perl -e"%h=(a=>200,b=>20,c=>2);$t{do{@_=();@_=(@_,map{($_->[0])x$_->[1]}[$a,$b]) while($a,$b)=each%h;$_[rand@_]}}++ for 1..1000;print%t;" a901b86c13