in reply to Re^2: string substitution
in thread string substitution

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;

Prints:

The quick &the dead.
True laziness is hard work