http://www.perlmonks.org?node_id=18728


in reply to removing duplicate letters

This seems to work:
s/(.)\1/$1/g;
The tr operator does what you want, except it squashes all duplicates, not just two. For reference though:
tr/a-zA-Z//s;