http://qs1969.pair.com?node_id=32003


in reply to sort performance

my @sortedkeys = sort { $hash{$a}->{this} cmp $hash{$b}->{this} } keys + %hash
You don't need the foreach loop, otherwise your method is fine (that's how I always do it.)

Update: Oh, my mistake... I see that @sortedkeys is the array for the foreach loop. So you are doing fine, although for fun we should try to come up with a bunch of methods and then benchmark them.