in reply to Re: Parsing a text file
in thread Parsing a text file

That's good advice, "Always use strict." Unfortunately, you've fallen almost at the first hurdle by forgetting to use my when opening your lexical filehandle. It is also recommended practice to test for the success of the open statement (and close as well) and to use it's three argument form.

open my $fIN, q{<}, q{msgcount.txt} or die qq{open: msgcount.txt: $!\n};

Failing to test for success can lead to "readline() on closed filehandle $fIN at myscript.pl line nnn" errors if, say, you mis-type the path or the file has been deleted or ...

I hope this is of interest.

Cheers,

JohnGG