Hi BrowserUk,
Thanks very much for this. Unfortunately, this syntax is above my head, though I would like to understand it. For starters, what exactly am I passing to "genPicker"? A file handle? A file name? I made a space-delimited file with A, B and C in the first column and the frequencies in the second column and tried in various ways to pass that into the subroutine but without success.
my $pick = genPicker( *DATA );What is "*DATA" here? I don't know how to get the "__DATA__" that you list near the bottom into *DATA form. Any help would be much appreciated.
Best wishes, Eric
In reply to Re^4: an algorithm to randomly pick items that are present at different frequencies
by efoss
in thread an algorithm to randomly pick items that are present at different frequencies
by efoss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |