That's probably not doing what you want, at least according the your original problem specification which called for removing spaces between, rather than after, characters. Consider:
use strict;
use warnings;
my $str = "The quick & the dead.";
$str =~ s/(\W)\s+/$1/g;
print $str;