perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Prime <>
Subject Re: srand
Date Sat, 04 Apr 2009 23:52:08 GMT
Stanisław T. Findeisen wrote:
> Hello
> I have a question regarding srand() usage with mod_perl. The 
> documentation says:
> =======================================================================
> Do not call srand() (i.e. without an argument) more than once in a 
> script. The internal state of the random number generator should contain 
> more entropy than can be provided by any seed, so calling srand() again 
> actually loses randomness.
> =======================================================================
> How does this relate to mod_perl? Is it safe to simply call srand() once 
> per CGI script?

Personally, i call srand in my, and not in individual cgi 
scripts.  I have no idea if that's actually a good practice or not 
though.  It might for example be a better idea to call it in a ChildInit 


View raw message