in reply to How do I pick a random line from a file?

This one only works in UNIX boxen:
$n = int rand `wc -l $file`; do { $l = $_ if $. == $n } while <>;