in reply to grabbing random n rows from a file

I think Tie::File is the answer here.