in reply to Re: search text file
in thread search text file
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: search text file
by Anonymous Monk on Jul 26, 2011 at 14:47 UTC | |
by jwkrahn (Abbot) on Jul 26, 2011 at 23:07 UTC | |
|
Re^3: search text file
by Anonymous Monk on Jul 26, 2011 at 12:25 UTC |