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