if($annotation =~ /(\b($term)\b|$term-)\b|(-$term)\b/i) { $nTermHits {$term}++; $nTotalHits++; push(@annotationlist, "$annotation\n"); } #### if($annotation =~ /(?:\b$term|$term-|-$term)\b/i) { #### foreach $term (@terms) { if ($nTermHits {$term} > 0) { printf "%s\t%d\n", $term, $nTermHits {$term}; } } #### foreach $term (keys %nTermHits) { printf "%s\t%d\n", $term, $nTermHits {$term}; }