$str ="Any help would be greatly appreciated"; $str =~ s/\s{2,}/\s/g;