http://qs321.pair.com?node_id=120658

hopes has asked for the wisdom of the Perl Monks concerning the following question:

Hi to all!:
I would like to know how srand works.
In srand it is said this:
Do not call srand multiple times in your program unless you know exactly what you're doing and why you're doing it. The point of the function is to "seed" the rand function so that rand can produce a different sequence each time you run your program. Just do it once at the top of your program, or you won't get random numbers out of rand! but doesn't explain the extrange behaviour of
srand (time ^ ($$ + ($$ << 11))); print join ",", map { srand (time ^ ($$ + ($$ << 11))); $_=int(rand(10)) }(0..10);

Yes, I know I was told not to do that, but I want to know WHY...:-)
Why canīt I modify the seed during the execution?
When is srand evaluated, in runnig time or during the parsing?
Why does de code generates equal numbers?

Hopes