use strict; use warnings; my $str1 = q{PF01389 6 218 1 255 430.09}; my $str2 = q{PF00691 PF01389}; my %str1Hash = map {$_ => 1} split m{\s+}, $str1; foreach my $possible (split m{\s+}, $str2) { print qq{$possible common\n} if exists $str1Hash{$possible}; }
I hope this is of use.
Cheers,
JohnGG
In reply to Re: Finding common substrings
by johngg
in thread Finding common substrings
by ktsirig
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |