If there are more than a very few lines that don't have ";drop;" in them, also put a next unless /;drop;/; just before the foreach.my %seen; my %newip_res; for my $ip (@newips) { $seen{$ip} = 0; $newip_res{$ip} = qr/;drop;[^"]*$ip/; } while(<LOG>){ foreach my $ip (@newip) { ++$seen{$ip}, print OUTFILE if $seen{$ip} != 500 && /$newip_res{$i +p}/; } }
In reply to Re: Re: Re: Correct Loop Structure
by ysth
in thread Correct Loop Structure
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |