Hi, i need to sort hash in descending order. but the issue is , in hash, i have key as integer value and the value associated with that key is string
so when i do sort it does not really sort the hash on the key level i used follwoing code foreach my $key (sort { $hash_fin{$b} <=> $hash_fin{$a} } keys %hash_fin) { print "$key => $hash_fin{$key}\n"; } the unsorted hash is : 12 => 20110622-035007-134 131 => 20110622-002139-131 107 => 20110621-215838-127 13 => 20110622-035007-134 129 => 20110621-235900-129 plz suggest irfan