in reply to Replace new line with white space

From Perl 5.10 onward, character class shortcut \R will match any kind of line break either working in DOS or UNIX based operating systems. Therefore you can do what you intend with the following substitute statement: s/\R/ /g Note: the "g" modifier replaces all the occurrences of the pattern matched.