If the order of the characters is of no concern, you can do it in one regex and the lookup hash:
perl -wple "%seen=();s/(.)/$seen{$1}++?'':$1/ge"
In reply to Re: Collapsing a string to unique characters
by Corion
in thread Collapsing a string to unique characters
by dwhite20899
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |