in reply to problems sorting hashes of hashes

Here you go:
for my $auth (sort { $hash{$b}{count} <=> $hash{$a}{count} } keys +%hash) { print FILE "$hash{$auth}{fname} $hash{$auth}{lname}: $hash{$au +th}{count}\n"; }
This will sort by count in reverse numerical order, from biggest count to smallest. If you want it the other way round, swap the $a and $b.

Replies are listed 'Best First'.
RE: Re: problems sorting hashes of hashes
by daemonchild (Acolyte) on Jul 02, 2000 at 01:18 UTC
    thank you!

    looking at your code, it makes perfect sense

    you wouldn't believe the stuff i was tryin to do before .. : )

    -- steve