Depending on how big the list is, this might be more efficient than shuffling the whole list for a small number of picks:
my @a = 4..20;; my @s = map splice( @a, rand( @a ), 1 ), 1 .. 8;; print "@a\n@s";; 4 5 7 8 9 12 13 14 18 11 10 6 20 15 17 19 16
In reply to Re: getting random number 8 times never the same
by BrowserUk
in thread getting random number 8 times never the same
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |