in reply to Replace new line with white space
Help me understand what you're asking. A newline (\n) is a species of whitespace. Do you mean replace each newline with a space character, i.e., " " (\x20)? If so, you can:
s/\n/ /g;
In Section
Seekers of Perl Wisdom