(Note: you need to use $x = join ' ', split ' ', $x; if your string isn't in $_.)