in reply to Random sampling a variable record-length file.

If you need statistically valid random numbers, don't use perl's rand(), it is not good for this purpose. It has patterns in it that will invalidate your results. I ran into this when I did a Monte Carlo simulation, and I was amazed at how bad the problem really is.

I tried several other algorithms for generating random numbers. Randomness turns out to be harder than it looks.

Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin. óJohn von Neumann

See for true random numbers.

It should work perfectly the first time! - toma