i have written this code but it doesnt work.
#!/usr/bin/perl -w use strict; my $domain; open(DOMAINLIST,'<domainlist'); my @list=<DOMAINLIST>; my $i=0; my $count=0; open(RESULT,'<result'); while($i<scalar(@list)){ $domain=$list[$i]; chomp $domain; while(<RESULT>){ for (my $line=$_){ chomp $line; if ($line=~/$domain/) { ++$count; print $domain; }}} ++$i; } print "$count"; close RESULT;
In reply to Re: search text file
by Anonymous Monk
in thread search text file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |