in reply to Capturing the first and last line of a file ?

A simple way:
print scalar <FOO>; while (<FOO>) {print if eof}

or

$ perl -ne 'BEGIN {print scalar <>} print if eof' /path/to/your/fi +le

Or you could use the toolkit:

system head => -1 => $file; system tail => -1 => $file;

The latter solution always prints 2 lines, even if the file contains 1 line - the first two solutions will print just 1 line. If the input file is empty, the first two solutions will start reading from STDIN, while the latter won't print anything.

Abigail