[CC'ing the modperl list]

Joey Hess wrote:
Brendan O'Dea wrote:

On Wed, Oct 01, 2003 at 03:30:40PM -0400, Joey Hess wrote:

Do you have any idea why perl 5.8.1 started seeding the RNG as soon as
perl starts? This is very annoying for mooix, all methods run by mood 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


Perhaps we should not be setting PL_srand_called when the hash is
seeded.


It occurred to me later that this could perhaps also affect things like
mod_perl. I have not checked though.

Indeed it's a problem in mod_perl 1. Thanks for the alert!


It will be fixed in the next release (1.29). Meanwhile setting an explicit seed at the server startup should be used as a temp workaround. e.g.:

env PERL_HASH_SEED=23452 apachectl start

There is no problem with mod_perl 2, which always explicitly seeds before the server startup, due to its own reasons.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to