I understand..thanks.
I found the issue but I still do not have a solution.
When reading the text files, one of the file I read in a string (by setting undef $/).
Therefore when I go the next file and want to read it line by line, I am getting the issue.
Now I am doing a
$/='\n';
before I read the next file line by line. But this is not helping. The file is being read in one line.
Any clues why?
Thanks