You don't need the foreach loop, otherwise your method is fine (that's how I always do it.)my @sortedkeys = sort { $hash{$a}->{this} cmp $hash{$b}->{this} } keys + %hash
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.
In reply to RE: sort performance
by Adam
in thread sort performance
by le
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |