On 4/4/09 19:52, Adam Prime wrote:
> Stanisław T. Findeisen wrote:
>> Hello
>>
>> I have a question regarding srand() usage with mod_perl. The
>> documentation says:
>>
>> ===
>>
2009/4/4 "Stanisław T. Findeisen" :
> How does this relate to mod_perl? Is it safe to simply call srand() once per
> CGI script?
It's safe, although there's not much reason to do it unless you have
access to something more random than what it will use by default. You
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
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
od get
the same random seed unless I waste time calling srand at method run
time.
This would appear to be an unexpected side-effect of the hash
randomisation introduced in 5.8.1 (see perldelta).
$ perl -le 'fork; print rand' 0.0327924393090768
0.0327924393090768
Perh
eed unless I waste time calling srand at method run
time.
This would appear to be an unexpected side-effect of the hash
randomisation introduced in 5.8.1 (see perldelta).
$ perl -le 'fork; print rand'
0.0327924393090768
0.0327924393090768
Perhaps we should not be set