@lines = ; #read the whole friggin' thing into memory $_ = @lines[int rand scalar @lines - 1];