I strongly suggest Math::Random::MT::Auto for any random number generation work.
The Mersenne Twister is a fast pseudorandom number generator (PRNG) th
+at is capable of providing large volumes (> 10^6004) of "high quality
+" pseudorandom data to applications that may exhaust available "truly
+" random data sources or system-provided PRNGs such as rand.
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.