http://qs321.pair.com?node_id=906248


in reply to Re^2: How to process multiple input files?
in thread How to process multiple input files?

He's always have a line-count of 1, since he's slurping the files.

$. contains the current record count, and since each file is one record it will be incremented for each file and so will not always be 1.    Unless of course you reset $. or close ARGV at the end of each file.

Replies are listed 'Best First'.
Re^4: How to process multiple input files?
by jaredor (Priest) on May 23, 2011 at 12:28 UTC

    Thanks for pointing this out. I have learned from you too.

    Furthermore, you've inspired me to reread the links I posted. Now I'm going back to strike kill my wrong summation of those links, which did have the right info, even if I didn't read them correctly.