drk_ender has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Help with random numbers
by Gloom (Monk) on Mar 03, 2001 at 01:46 UTC
    see the rand function with perldoc

    _________________
    Hope this helps
Re: Help with random numbers
by AgentM (Curate) on Mar 03, 2001 at 01:54 UTC
    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.
Re: Help with random numbers
by rpc (Monk) on Mar 03, 2001 at 04:45 UTC
    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.

Re: Help with random numbers
by diskcrash (Hermit) on Mar 04, 2001 at 11:52 UTC
    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
Re: Help with random numbers
by magnus (Pilgrim) on Mar 03, 2001 at 04:39 UTC
    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

      Actually, in modern Perl, you don't need to explicitly call srand. Let Perl do it for you.

A reply falls below the community's threshold of quality. You may see it by logging in.