Minor correction for this plugin, since it always rounds down:
Code:
#Usage: plugin::RandomRange(minvalue, maxvalue);
sub RandomRange {
my $MinRandom = $_[0];
my $MaxRandom = $_[1];
my $RandomResult = int(rand(($MaxRandom + 1) - $MinRandom)) + $MinRandom;
if ($RandomResult > $MaxRandom)
{
return $MaxRandom;
}
return $RandomResult;
}
Without the + 1 there, the old way wasn't able to reach the max random number.