in reply to random num generator

How "random" are you talking about? Computers are very deterministic, and making them generate high-quality random numbers is quite non-trivial. If you just need a little fudging in your equations, look at the rand suggestions here. If you need something that can't be easily predicted, you'll need Crypt::Random or a similar module.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated