in reply to Hash of Arrays Sorting Problem

Here is what I think is a simple approach that is easy to maintain:

foreach my $sorter ( keys %hash ) { print "\n\nSORTER=$sorter"; my @time; foreach my $domain ( keys %{$hash{$sorter}} ) { foreach my $time ( @{$hash{$sorter}{$d­omain}} ) { push @time, "$time $domain" . "\nDomain=$domain, Time=$time"; } } foreach my $line ( sort @time ) { my $output= ( split /\n/, $line, 2 )[1]; print $/, $output; } }
You create a list of strings, each one starts with a string built such that the default sort will put them in the order that you want...

I'm assuming your "time" has leading zeros and fields order from largest to smallest (days before hours before minutes before seconds, for example) so that no reformatting is required, and that you'd like to sort within duplicate times based on domain. So this part is simply "$time $domain".

After that part, put a delimiter and the value you want to get in the end. The "\n" you already had at the front of your desired result makes a fine delimiter.

Then sort your list. Throw away the first part of each string and print out the last part.

        - tye