in reply to IP Parse and Count from logfile

The counting is easy enough: Just add a new hash, my %ip_addresses; and then, after you get the ip address into $IP, do a $ip_addresses{$IP}++; to increment the count of how many times the address has been seen.

To print out the list of seen addresses with their counts, use

for my $addr (sort keys %ip_addresses) { print $addr, ': ', $ip_addresses{$addr}, "\n"; }
BTW, you appear to be missing the declaration for $IP (my $IP;), which will be needed for the code to run under strict once the IP regex is uncommented.

(Code fragments not tested, but simple enough that they should work... (Famous last words, I know.))