in reply to Re: How do I shuffle an array?
in thread How do I shuffle an array?

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.