in reply to simple search in a file

here's what I would write:
my $MATCH=0 while(<infile>) { if ($_ eq "$ip\t\t$date\n") {$MATCH=1; last;} }