in reply to How to remove \n between two words but retain one space

One way to normalize whitespace:

$foo = join ' ', split " ", $foo;
That uses magical split.

After Compline,
Zaxo