in reply to How to remove duplicate characters in a string in place

I can't think of a way to do it with a single s///, but this works:
use strict; use warnings; my $str = "abcdefghiaabccdjklm"; my @chars = split //, $str; my %uniq; $uniq{$_}++ for @chars; $str = ''; for (@chars) { $str .= $_ unless $uniq{$_} > 1; } print $str; __END__ efghijklm