Try it like this:
#!/usr/bin/perl use warnings; use strict; open DOMAINLIST, '<', 'domainlist' or die "Cannot open 'domainlist' be +cause: $!"; chomp( my @list = <DOMAINLIST> ); close DOMAINLIST; open RESULT, '<', 'result' or die "Cannot open 'result' because: $!"; while ( my $line = <RESULT> ) { for my $domain ( @list ) { ++$count while $line =~ /$domain/g; } } close RESULT; print "$count\n";
In reply to Re^2: search text file
by jwkrahn
in thread search text file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |