in reply to Random Imaging

srand(time ^ $$);

Eeew! Where did you get this from? Many, many moons ago I wrote a little CGI program that randomly returned an image as well, and I discovered that it would often return the same image twice in a row, if you have seed the random generator with time ^ $$. I posted about this to the newsgroup more than seven years ago. http://groups.google.com/groups?selm=3148E9E1.21CA6C29%40www.iaf.nl&output=gplain This resulted in the Camel II already warning against this usage, and later versions of Perl using a much better default salt.

Why, o, why, did you pick such a bad seed?

Abigail

Replies are listed 'Best First'.
Re: Re: Random Imaging
by waswas-fng (Curate) on Aug 01, 2003 at 15:33 UTC
    many moons ago I wrote a little CGI program ... with time ^ $$ ... I posted about this to the newsgroup more than seven years ago ... Why, o, why, did you pick such a bad seed?

    Perhaps it is a comon mistake for new people to random numbers and perl? It sounds like you learned from your mistake 7 years ago. =)

    -Waswas
      I was doing what was common practise back then. Since then common practise has changed, and the documentation explicitely warns against using time ^ $$. So, my question remains, why did you choose time ^ $$?

      Abigail