Your code works fine, but it includes 250 and excludes 500.
Direct quote from perldoc -f rand:
Apply "int()" to the value returned by "rand()" if you
+want
random integers instead of random fractional numbers.
+For
example,
int(rand(10))
returns a random integer between 0 and 9, inclusive.
With this in mind take a look at my reply and apply a
small tweak:
my @answers=();
push @answers,(int(rand(251))+250) foreach (0..99);
The sequence
int(rand(251)) will now produce
integers in the range of 0..250 and when added to 250
will produce 250..500.