sub process_it { my ($rec_line) = grep(/received from internet:/, @_); my ($from, $tmp) = ( split(/:/, $rec_line) )[3, -1]; $from =~ s/(fromhost=|$CHARS)//g; my $count = $tmp =~ s/@/@/g; my @data = grep(!/received from internet:/ and !/Error-Handler/, @_); my $total_c; foreach my $line (@data) { my @line = split(/:/, $line); my ($tmp_c, $type); if ($line[0] =~ /( |-)([a-zA-Z]+)$/) { $type = $states{$2}; warn "NO type: $line[0]\n" if ($type =~ /^(\s+|)$/); $tmp_c += ($type =~ /del_rem/) ? $line[$#line] =~ tr/@/@/ : 1; } $by_type{$from}{$type} += $tmp_c; $total_c += $tmp_c; } $by_ips{$from}+= $total_c; }