in reply to Re^2: random number with range
in thread random number with range

Indeed, but the technique is particularly useful for sets. For example,

my @set = ( 1, 2, 3, 5, 8, 13, 21 ); my $random = $set[rand(@set)];
my @set = qw( apple orange banana cucumber ); my $random = $set[rand(@set)];