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, '1-3' => 3 ); my $t = Tie::IxHash->new(%hash); $t->SortByValue; # ascending, ok!
$t->$hash{$b}<=>$hash{$a}SortByValue; #tried this but doesn't work
__END__
Can anybody advice how to go about this? Thanks beforehand.
Regards, Edward WIJAYA SINGAPORE
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>