open LOG, "<$log_file" or die "Could not open $log_file\n"; my %ip_count; while () { my ($ip, $severity, $date, ...) = split /\s*,\s*/; $ip_count{$ip}++; # other summary stat calcs below }