#!/usr/bin/env perl do "common.pl"; %user_agent; %proxy; open(FILE,$file); while() { /(\S*)\ \S*\ \S*\ \S*\ \S*\ \S*\ \S*\ \S*\ \S* \S*\ ".*"\ (.*)$/; $host = $1; $agent = $2; if ( exists $user_agent{$host} ) { if ( $user_agent{$host} ne $agent ) { $proxy{$host} = "YES"; } } else { $user_agent{$host} = $agent; } } close(FILE); $total = scalar(keys %user_agent); $proxies = scalar(keys %proxy); print "proxy/others hosts: $proxies/$total ", percent($proxies,$total), "\n"; exit(0);