$str ="Any help would be greatly appreciated"; $str =~ s/\s{2,}/\s/g; [download]
In reply to Replace consecutive whitespaces with single whitespace by Anonymous Monk