in reply to How To Count Lines In File?

Instead of the FAQ's rather verbose loop, you can achieve the same effect using
{ local ($/, $_) = (\4096); $lines += tr/\n// while <$fh>; }

Makeshifts last the longest.