note
Riales
<p>Your main problem is when you check to see if the source matches any of the terms, you're only checking the last term in the file.</p>
<p>You're also trying to print a match with the <code>$1</code> but that's not really what you want.</p>
<p>Beyond that, is there a particular reason you're choosing to use hashes instead of arrays? I would think arrays are more what you want.</p>
<code>
# Building the array of terms:
my @terms = ();
while (my $term = <F1>) {
chomp $term;
push @terms, $term;
}
</code>
<p>This way, when you are checking each term against the source, you just need to do this:</p>
<code>
# Printing sources that do not match of of the terms:
while (my $source = <F2>) {
chomp $source;
print "$source\n" unless grep { $source =~ /$_/ } @terms;
}
</code>
963141
963141