open IN, $file or die $!;
1 while <IN>;
close IN;

print $.;