Recipe 8.6. Picking a Random Line from a File (Perl Cookbook)
csg.sph.umich.edu/chen/Perl/cookbook/ch08_07.htmrand($.) < 1 && ($line = $_) while <>;
Pick a random line from a file without knowing its size beforehand. The algorithm can be easily adjusted to many a thing...
How come Perl is so fun?