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


in reply to Re: How to reset a variable for each file inside a while( <> ) loop?
in thread How to reset a variable for each file inside a while( <> ) loop?

$. won't hold the line number of the current file when iterating via <>.

Because "<>" never does an explicit close, line numbers increase across ARGV files (but see examples in "eof" in perlfunc).

from perldoc -v '$.' (the same section of perlvar you mentioned).

Update: you need eof trick toolic mentions.

Update:: Ok. I cheated (as noticed at Re^3: How to reset a variable for each file inside a while( <> ) loop?) -- to use perldoc -v you need a brand new Pod::Perldoc like the one at Pod-Perldoc-3.14_07.