in reply to how to remove a specific character from a file efficiently..

Are you saying that the input files now have new line characters in the middle of each record?

Assuming that's the case, why not just:

$line =~ s/\n//g;

And, as previously mentioned, if you can operate directly on $_ you will save the overhead of copying each line.