How can I replace multiple whitespace with a single space in Perl?

Viewed 40020

Why is this not working?

$data = "What    is the STATUS of your mind right now?";

$data =~ tr/ +/ /;

print $data;
3 Answers
Related