http://www.perlmonks.org?node_id=91135


in reply to Per cents and Probabilities

It seems like what you want is biased/weighted random number selection, where the weights are stored as the keys of a hash. You might take a look at this previous node, which has some good responses: Biased random number selection. You could probably adapt one of those responses to your own needs.