in reply to How to check if a file has more than one line?
The special variable $. gives you the current line number for most recently used file handle. So, if you are reading a file, $. will tell you how lines in to the file you have read.