http://qs321.pair.com?node_id=353097


in reply to Re:^2 Remove repeated characters from a string
in thread Remove repeated characters from a string

This will do that for you:

1 while $string =~ s/(.)(.*)\1/$1$2/g