in reply to srand producing the same sequence of random numbers
ActivePerl on Windows:
>perl -wle"for (12892579, 12581113, 11469568) { srand($_); print rand( +10) for 1..3; print ''; }" 8.4423828125 8.1201171875 0.3485107421875 8.04290771484375 1.88720703125 7.26837158203125 0.30426025390625 3.8690185546875 3.51715087890625
Linux:
$ perl -wle'for (12892579, 12581113, 11469568) { srand($_); print rand +(10) for 1..3; print ""; }' 7.28681520399736 9.72810111099051 8.4866120390701 4.16810684212582 9.99273993631022 1.63078077641455 4.64624992645444 9.91696268643381 6.90260832469118
What output do you get? What platform? (perl -V, that's an uppercase "V")
|
|---|