in reply to reading a random line from a file

Just pick a random position in the file and seek() backwards until you find the line separator or the beginning of the file e.g
open(my $f, $your_file) or die("ack: $!"); seek($f, int rand(-s $f), 0); { local $/ = \1; ## anyone care to optimise this? seek($f, -2, 1) until ($c = <$f>) eq "\n" or tell($f) == 0; } print scalar <$f>;
That should print out a random line in a file without having to do a slurp.
HTH

_________
broquaint