rand

Returns a random fractional number greater than or equal to 0
and less
than the value of EXPR. (EXPR should be positive.) If EXPR is
omitted, the value 1
is used. Currently EXPR with the value 0
is
also special-cased as 1
(this was undocumented before Perl 5.8.0
and is subject to change in future versions of Perl). Automatically calls
srand unless srand has already been called. See also srand.

Apply int() to the value returned by rand() if you want random
integers instead of random fractional numbers. For example,