in reply to Unique List of Common Characters Between Two Strings

Or, if you're a regex fan, you might like...
sub In_Common2 { my ($str1, $str2) = @_; (my $common = reverse $str2) =~ s/[^$str1]|(.)(?=.*\1)//g; return scalar reverse $common; }


-- All code is 100% tested and functional unless otherwise noted.