Re: Sinister variable caching problem with rand()

Anthony Esposito <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
PS.

I had to strengthen the srand() function I added to the startup.pl that
Cosimo suggested. I used the example from the perldoc and have not had any
duplicate keys so far. I was having upwards of 3 per 1000 when using
srand(time ^ $$)

Fix added to startup.pl file
---------------------------------------

my $srv = Apache2::ServerUtil->server;
$srv->push_handlers(PerlChildInitHandler => sub { srand(time ^ $$ ^ unpack
"%L*", `ps axww | gzip -f`) } );

---------------------------------------

On Sat, May 15, 2010 at 3:02 PM, Michael Peters <[email protected]>wrote:

> On 05/15/2010 04:47 PM, André Warnier wrote:
>
>>
>> A tip : to get a really unique identifier
>>
>
> Another tip: to get a really unique identifier use mod_unique_id or
> Data::UUID or the UUID() function in mysql.
>
> --
> Michael Peters
> Plus Three, LP
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.