Put $seen = 0; inside the while loop but outside of the foreach.
Update: Although I'd probably do something clsoer to
while(<LOG>){ foreach my $i (@newips){ if (/\;drop;[^"]*$i/) { print OUTFILE for 1 .. 500; } } }
(Untested)
In reply to Re: Correct Loop Structure
by bmann
in thread Correct Loop Structure
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |