in reply to read lines... wait, back up?

If you only want to keep knowledge of the last 'few' lines, you can keep a rolling array. Something like...
$num_to_keep = 10; while( <FILE> ) { push @saved_lines, $_; ...do your stuff... shift @saved_lines if @saved_lines > $num_to_keep; }
Any good (1st perl monk post...:-)