B
bukzor
Hi,
I'm trying to find the fastest way in perl to see if a name contains
another.
I've a list of 2704 names (aka "A")
I've another name (aka "B")
I need to know if any of A is contained in B.
A = foo foo1 foo2 foo3 foo45 ....
B = INCASE_foo2_YOUWANT
is a match
B = INCASE_YOURDONOTWANT
is not a match.
what would be the fastest way to check the 2704 possible values of
"A" ?
Thanks,
so far, I'm using
foreach $t (keys %A) {
$v = $B;
$v = s/$t//;
if ($v ne $B) {
print "MATCH"
}
}
I'm trying to find the fastest way in perl to see if a name contains
another.
I've a list of 2704 names (aka "A")
I've another name (aka "B")
I need to know if any of A is contained in B.
A = foo foo1 foo2 foo3 foo45 ....
B = INCASE_foo2_YOUWANT
is a match
B = INCASE_YOURDONOTWANT
is not a match.
what would be the fastest way to check the 2704 possible values of
"A" ?
Thanks,
so far, I'm using
foreach $t (keys %A) {
$v = $B;
$v = s/$t//;
if ($v ne $B) {
print "MATCH"
}
}