in reply to Efficient matching with accompanying data

I don't understand why you're using a tree

Consider
my @dictionary = qw/ fa la barf /;
my $in_dictionary = join '|', map \&quotemeta, @dictionary;
for my $string ( @strings ){
while( $string =~ m{($in_dictionary)}g ){
print "word=$1\n"
}

  • Comment on Re: Efficient matching with accompanying data (tree)