open(IN, "<$accesslog_file") or die "Cannot open $accesslog_file for input: $!\n"; while(defined(my $line = )) { chomp $line; if($line =~ /(.*?) - - \[(.*?)\/(.*?)\/(.*?):(.*?):(.*?):(.*?) (.*?)\] \"(.*?)\" (.*?) (.*?)/) { my $host = $1; my $day = $2; my $month = $3; my $year = $4; my $hour = $5; my $minute = $6; my $second = $7; my $timezone = $8; my $request = $9; my $response = $10; my $unknown = $11; $host = &dns_lookup($host); # push information into our hash # adds a reference to the log entry array into # the hash element for this host push @{ $hosts{$host} }, [ $month, $day, $year, $hour, $minute, "'$request'", $response ]; } } close(IN);