Of course you can just write$array[int(rand(scalar(@array)))];
which will do exactly the same thing and is a bit less distracting to read.$array[rand @array];
Makeshifts last the longest.
In reply to Re^2: Pulling random elements from hash
by Aristotle
in thread Pulling random elements from hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |