in reply to Replace consecutive whitespaces with single whitespace
Check with the following code
$str ="Any help would be greatly appreciated + "; $str =~ s/(\s)+/$1/g; print $str; [download]
Your Attempt May Fail, But Never Fail To Make An Attempt