in reply to How to avoid the duplication in a string
$ perl -wle '%h = map { print unless defined($h{$_}); $_ => $h{$_}++ } + split(//,q{abcdabcdabcd}); ' a b c d [download]