in reply to How do I find the total number of lines in a file?

You can use the $. variable ($/ defaults to \n)
while(<>){}; print "$. lines\n";