Help for this page
$totals = ( $source => { $destination => $count, }, );
my %totals; while (<LOGFILE>) { $totals{$1}->{$2}++ if m/(...)(...)(...)/; }
my $sth = $dbh->prepare('insert into totals (srcIP, dstIP, visit_count +) values (?, ?, ?)'); foreach my $source (keys %totals) { $sth->execute($source, $_, $totals{$source}->{$_}) for keys %{ $to +tals{$source} }; }
%ips = ( $src => "$dst"); foreach $ws (keys(%ips)) { ... }