Re: Howto reverse SortByValue with Tie::IxHash

2004-10-02 Thread Edward Wijaya
On Sat, 2 Oct 2004 08:53:02 -0500, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: This is a tough one. You need to supply a list of keys to the Reorder() method. Getting the list of keys already sorted by value may not be apparent to a beginner. $t->Reorder( reverse $t->SortByValue()->Ke

RE: Howto reverse SortByValue with Tie::IxHash

2004-10-02 Thread Charles K. Clarkson
Gunnar Hjalmarsson wrote: : Edward Wijaya wrote: : : : : my $t = Tie::IxHash->new(%hash); : : $t->SortByValue; # ascending, ok! : : : : $t->$hash{$b}<=>$hash{$a}SortByValue; # tried this but : : # doesn't work : : Where in the d

Re: Howto reverse SortByValue with Tie::IxHash

2004-10-02 Thread Gunnar Hjalmarsson
Edward Wijaya wrote: my $t = Tie::IxHash->new(%hash); $t->SortByValue; # ascending, ok! $t->$hash{$b}<=>$hash{$a}SortByValue; #tried this but doesn't work Where in the docs for Tie::IxHash did you find that syntax? You can obviously not just guess and hope that Perl will read your mind. Did you

Howto reverse SortByValue with Tie::IxHash

2004-10-02 Thread Edward Wijaya
Hi, I have a problem using Tie::IxHash. My question is how can I sort the hash by value in descending order. I tried this to get the descending order, but doesn't seem to work: __BEGIN__ my %hash =( '1-1' => 3, '2-3' => 2, '2-2' => 1, '1-2' => 6,