_Analyzing Web Traffic with Perl_ by Frederic Bien, Michel Delory, and Rick McGillis Listing One while() { if(/^(\S*).*\[(\S*).*\].*\"(.*)\"\s*(\d*).*$/) { $visitor = $1; $dateTime = $2; $request = $3; $status = $4; } } Listing Two ($counter, @stamps) = split($;, $Visitors{$visitor}); #split the # values for this key $counter++; #increment the counter do AddStampToList(*stamps, $timeStamp); #add current timestamp # to the list of # timestamps for # this visitor $Visitors{$visitors} = join($;, $counter, @stamps); #join the values Listing Three sub ResolveIP { local ($ip) = @_; local ($addNum); $AF_INET = 2; $addNum = pack ('C4', split (/\./, $ip)); (gethostbyaddr ($addNum, $AF_INET))[0]; } Example 1: myhost.mymachine.com - - [07/Apr/1996;14:11:33 -800] "GET /gifs/space.gif HTTP/1.0" 200 4745 Example 2: Success Codes 200: OK, request fulfilled. 201: Created. 202: Accepted. 203: Partial information. 204: No content. Redirects 300: Multiple choice. 301: Moved permanently. 302: Moved temporarily. 303: Method. 304: Not modified. Errors 400: Bad Request. 401: Unauthorized. 402: Payment required. 403: Forbidden. 404: Not Found. 500: Internal server error. 501: Not implemented. 502: Bad gateway, service overload. 503: Service unavailable or server timeout. Example 3: (a) remote_host rfc931 authuser [date_time] "request" status bytes "http_referrer" "user_agent" (b) remote_host rfc931 authuser [date_time] "request" status bytes "http_referrer" "user_agent" vdm duration_in_secs