my $random=int rand($max+1); unless($random eq $max)
The correct way to compare numbers is ==, not eq.
And when you want to exclude $max from the range of random numbers, write my $random = int rand($max); in the first place.
In reply to Re: Answer: How do I shuffle an array?
by moritz
in thread How do I shuffle an array?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |