# 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 = <ACCESSLISTIPS>); 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"; }
In reply to Re: How to sort HASH?
by u235sentinel
in thread How to sort HASH?
by iwanthome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |