in reply to Re^4: 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?

I'd recommend to follow what toolic advised: close the file instead of manually nulifying $. The value of $. is reset automatically when the file is closed, so the following does what you need:
while (<>) { print "$ARGV.$.:$_\n"; close ARGV if eof; }
  • Comment on Re^5: How to reset a variable for each file inside a while( <> ) loop?
  • Download Code