in reply to Legacy code uses "srand()" .. how to avoid losing entropy?
I had stuff that needed to repeat and not be thrown off by other uses of random, so it used its own instance for the purpose.
You want to simulate that without changing the line-by-line uses, by saving/restoring the global: Well, if the built-in srand is not accessible, use Perl techniques to replace the core::srand or a per-module view of srand to call your code, which does allow such a thing to be done. Better yet, have the srand replacement be a call to the object version so you can replace old-style calls with new ones incrementally without changing the sequence generated.
|
|---|