Hi, I have a array more than 100 element and I want to pick up 10 element randomly from that array. My coded for this is:
for my $x (0..9) { my $element = $quest[ rand @quest ]; print $element; }
But, at times, the elements picked up are repeating. I want to pick up 10 unique elements randomly from the array. Can anyone help me how to do it?
In reply to Picking unique element in random from a array by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |