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 | |
|
Re^2: Find characters in ALL strings
by kyle (Abbot) on Sep 20, 2007 at 18:14 UTC | |
|
Re^2: Find characters in ALL strings
by n8g (Sexton) on Sep 20, 2007 at 17:47 UTC |