update: fixed confusing (and wrong) mix of array and array-refs.@array_of_items = [ ... get items from database ]; print map { $array_of_items[$_ -1] } random_subset_X(scalar(@array_of_ +items), $count);
update 2: subtract from index, since output values are 1 .. max instead of 0 .. max -1.
In reply to Re: Updating sub for random number generation
by Joost
in thread Updating sub for random number generation
by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |