in reply to Replace consecutive whitespaces with single whitespace

Another way to do it:

$ perl -le' my $str = "Any help would be greatly appreciated"; $str =~ tr/ //s; print $str; ' Any help would be greatly appreciated