#!/local/bin/perl
#
# usage.byhost -- summerize log into host entries
#
# $Id: usage.byhost,v 2.3 1993/06/29 02:40:35 sanders Exp $
#

select(STDIN); $| = 1; select(STDOUT); $| = 1;

while (<STDIN>) {
    next if (/^-/ || /^\s*$/);
    $count{(split(' '))[0]}++;
}

foreach $i (keys(%count)) {
    printf("%6d %26s  (%s)\n", $count{$i}, 
	   (gethostbyaddr(pack('C4',split(/\./,$i)),2))[0], $i);
}
