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

My favourite method to get the number of lines in a file is:
$line_count = `wc -l < $file`;
The redirection there is on purpose, without the < there, you get a different answer.