$x='justice ,tan south jer,nor the pearl,her packer'; $_='ice'; foreach $y (split ',', $x) {$i=length; while($i) {$z=quotemeta;$y =~ s/[$z]//;$z =~ s/$&//;$_=$z; $i--;} $_=$y;s/ //g;print&&print $&;}