in reply to Unique visits - Webserver log parser
This leaves out a host of other issues but it's a first step. #1 Visitors and IPs don't have a 1 to 1 mapping (proxies/AOL/etc). It will probably save you a ALOT of subroutine calls and the scanning of the @iplist on a file that big though.# Change while (<FILE>) { /(.*)\s-\s-/; $ip = $1; if (notInList($ip)) { $i++; addToList($ip); } } # To my %IPs_Seen = (); while (<FILE>) { # Add 1 to the key $1 (The match) $IPs_Seen{$1} ++ if m/^(.*)\s-\s-/; } #later print "\nVisits for $file is ",scalar(keys %IPs_Seen),"\n"; # To access the ips found. my @ips = keys %IPs_Seen;
|
|---|