|
|
| Just another Perl shrine | |
| PerlMonks |
Re^2: How do I make a random shuffle deterministic?by LanX (Monsignor) |
| on Dec 05, 2012 at 17:15 UTC ( #1007340=note: print w/ replies, xml ) | Need Help?? |
|
Most implementations of "srand" take an integer and will silently truncate decimal numbers. This means "srand(42)" will usually produce the same results as "srand(42.1)". To be safe, always pass "srand" an integer.most strings will evaluate to 0 ! You need a checksum to produce a (pseudo) unique integer. You could try $seed += ord($_) for split //, hostname But whats wrong with the IP? Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||