Yup, rand is zero inclusive.
For rounding, you have several options:
- int, which returns the integer portion of an expression. This is probably not what you're looking for, though.
- sprintf, which lets you format your number exactly the way you like it. Remember, there's no real difference betwen string and number variables in perl.
- POSIX::ceil or POSIX::floor, which are the equivalent of ceil and floor in C.
See also: Does perl have a round function? What about ceil() and floor()? Trig functions?
Cheers,
--Moodster