in reply to Count file lines in a directory tree

++$lines while (<inFile>);
why not just use $.?
1 while <inFile>; $lines += $.;

Replies are listed 'Best First'.
Re^2: Count file lines in a directory tree
by GrandFather (Saint) on Nov 09, 2005 at 10:06 UTC

    Too little coffee early in the day :)


    Perl is Huffman encoded by design.
Re^2: Count file lines in a directory tree
by Aristotle (Chancellor) on Nov 10, 2005 at 03:00 UTC
    { local $/ = \131072; $lines += tr/\n// while <inFile>; $lines++ if not /\n\z/; }

    Makeshifts last the longest.