in reply to Syntax error sorting hash keys
But including $a cmp $b doesn't slow anything down, since any of $a cmp $b, $b cmp $a, $a <=> $b, or $b <=> $a is optimized away and handled internally by the sort operation. Any other comparison block gets executed as real perl code, so is quite a bit slower.for my $key (sort keys %$hashref) {
|
|---|