in reply to Legacy code uses "srand()" .. how to avoid losing entropy?

You could copy the C code from your systems library that implements rand/srand, and use XS to create functions rand2/srand2, and have either your known sequences or your random sequence generated using rand2/srand2.

Or perhaps your system has srand48_r and drand48_r. Write some XS to interface with that, and you'll have access to the state that's being kept. So you can have several sequences (known and random).