in reply to Randomly select N lines from a file, on the fly
See also improving the efficiency of a script.