Add a print when at least 1 of the words match if that's the output you want
pojwhile (my $line = <FIC>) { my @words = split /\s+/,lc $line; ++$uniq2{$_} for @words; $words2 += @words; ++$count2; my @match = grep $uniq1{$_}, @words; print $line if @match >= 1; # <-- add here }
In reply to Re^9: compare two text file line by line, how to optimise
by poj
in thread compare two text file line by line, how to optimise
by thespirit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |