my $file=$logpath . $ip; print "\$counter=$counter: opening $file\n" if $debug; print "\$counter=$counter: printing $date to $file\n" if $debug;