http://qs1969.pair.com?node_id=1179411

R56 has asked for the wisdom of the Perl Monks concerning the following question:

Hey all! Hoping someone can help me solve a little problem.

I'm parsing a block of free text in a file, and I have a pre-loaded array of specific terms.

When I parse that block of text into a string, I'm looking to cross reference each word on that string with the terms I have on the array. If there's a match between the two, print it out.

if($text =~ /upperboundary(.+)lowerboundary/s){ if(grep {$_ eq $1} @terms){ print OUT "$1\t"; } }

This doesn't work, and I searched for a while on how to do it, to no avail. Can someone point me in a better direction? Thanks in advance!