see the rand function with perldoc
_________________
Hope this helps | [reply] |
Other options include the various CPAN modules which generate random numbers or data which can be found by searching for Rand.
AgentM Systems nor Nasca Enterprises nor
Bone::Easy nor Macperl is responsible for the
comments made by
AgentM. Remember, you can build any logical system with NOR.
| [reply] |
It really depends on how secure you need your random numbers to be.
If you need a high amount of entropy, don't even think about using rand, or any other PRNG algorithm. There is Crypt::Random, however that depends on Math::Pari which I've had problems installing.
Long story short, if you need security, either use the abovementioned module, or check for the existance of a secure random number device such as /dev/random. Unfortunately, not all operating systems support this device node. | [reply] [d/l] |
If you need a truly provable random number you can use a radioactive sensor and random number software from Aware Electronics. http://www.aw-el.com/
It measures the timing of cosmic rays and local sources like radon decay to form a random number. I have one of their Geiger Counters for radiation measurement and it works fine. - Diskcrash | [reply] |
don't forget your friendly helper srand when you're digging through those man pages... it will help give you a different randomized number every time you run your program...
but it's all there in the docs...
magnus | [reply] |
| [reply] |