# This section will count the number of times we see an ip address open ACCESSLISTIPS, "access_log_ips" or die "The file could not be opened ($!)"; chomp(@ips = ); foreach $ip (@ips) { $count{$ip} += 1; } # This routine will sort the values of a hash then print them out for us. # foreach $ip (sort { $count{$a} cmp $count{$b} } keys %count) { print "$ip was seen $count{$ip} times.\n"; }