Pd Schloss wrote:
>
> I'm reviewing a perl script that someone wrote to do a statistical
> analysis.  I know it's bad form, but I was wondering if anyone knows
> what the default seed is for the random number generator in Perl.  They
> haven't seeded it with "srand" - what does this do?  It still seems to
> pick random numbers, any ideas?

Hi. I wrote this back in March. I assume I was right :)

Rob Dixon wrote:
>
> Interesting. Digging into the code for Perl v5.6.1, 'srand' will try to read four
> bytes from the /dev/urandom device. If that fails, then it will read the current
> time of day and mix it up with the PID, a Perl stack pointer and a few arbitrary
> constants.

So, as it should be, there is no 'default' seed.

This probably doesn't help, but at least should end your search!

Cheers,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to