in reply to How to sort HASH?

You can not reorder the hash, you want to order the keys of the hash.
@ordered_keys = sort {$flows{$b}{pkts} <=> $flows{$a}{pkts} or $flows{$b}{size} <=> $flows{$a}{size} } keys %flo +ws;
Boris

Replies are listed 'Best First'.
Re: Re: How to sort HASH?
by iwanthome (Beadle) on Apr 05, 2004 at 09:24 UTC

    thanks! I have a stupid error.

    I will try to sort the keys of the hash