in reply to Replace new line with white space
I suspect that what you really need is chomp, and that you don't need a regex at all.
However, without seeing your code we can't confidently advise you either way.while (<$fh>) { chomp; # Line in $_ no longer has trailing \n
In Section
Seekers of Perl Wisdom