$j = "Jim Plank"; $j =~ s/(\w*) (\w*)/\1 \1 \2/; print "$j\n"; $i = "I am the the man"; $i =~ s/(\b\w+\b) \1/\1/; print "$i\n";