in reply to Hash sorting by values

In general you can sort a hash by value using a construct such as:
for my $key (sort {$hash{$a} cmp $hash{$b}} (keys %hash)) { print "Key = $key, Value = $hash{$key}\n"; }
though I don't see why you want to do it in the code above.

update ok, I get it now... $message isn't in its final form above... I was wondering why you wanted the body of your email to consist of value sorted elements in the %ip2date hash.

-Blake