in reply to Find characters in ALL strings

You could use a negated character class using all but one of your strings to remove those characters using s///:
my @s = qw/ 1234579 234789 4578 /; my $common = pop @s; $common =~ s/[^$_]//g for @s; print $common; # 47

update: reworded description of solution. It's still crap, though:(

Replies are listed 'Best First'.
Re^2: Find characters in ALL strings
by ikegami (Patriarch) on Sep 20, 2007 at 18:13 UTC
    Nice! You should probably use quotemeta in case the strings contain special characters.
    my $common = pop @s; $common =~ s/[^\Q$_\E]//g for @s;
Re^2: Find characters in ALL strings
by kyle (Abbot) on Sep 20, 2007 at 18:14 UTC

    This will die if it hits a string the regex sees as relevant but invalid (e.g, "7-4").

Re^2: Find characters in ALL strings
by n8g (Sexton) on Sep 20, 2007 at 17:47 UTC
    I like this one better than mine. It is cleverer.