#Chapter 8.6. Picking a Random Line from a File #Problem: You want to return a random line from a file. #Use rand and $. (the current line number) to decide #which line to print: srand; rand($.) < 1 && ($line = $_) while <>;