Why is this not working?
$data = \"What is the STATUS of your mind right now?\"; $data =~ tr/ +/ /; print $data;
You can also use tr with the "squash" option, which will remove duplicate replaced characters. See perlop for details.
tr
my $s = "foo bar fubb"; $s =~ tr/ //s;