in reply to What are the other option for sorting the keys of hash of hashes

keep an ARRAY of hashes, keep it sorted
  • Comment on Re: What are the other option for sorting the keys of hash of hashes

Replies are listed 'Best First'.
Re^2: What are the other option for sorting the keys of hash of hashes
by luckypower (Beadle) on Sep 29, 2008 at 11:27 UTC
    But i want to sort it according to the values of hashes....
    so how to sort an array of hashes according to hashes value ...??
      so how to sort an array of hashes according to hashes value ...??
      Same,
      @hash = sort {$a->{"Size"} <=> $b->{"Size"}} @hash;
      Faster still, array or arrays
      @hash = [ blah1 => 33], [ blah2 => 44 ]; @hash = sort {$a->[1] <=> $b->[1] } @hash;
      So which is more useful? flexible? easier to write maintain? Whats cheaper, your time, or computer time?