keysort is an XS implementation of the Schwartzian transformWell, not really. It is more like this:
sub sortkey (\&@) { my $calc_key = shift; my @key = map $calc_key->(), @_; return @_[sort { $key[$a] cmp $key[$b] } 0..$#_]; }
In reply to Re: Unusual sorting requirements; comparing three implementations.
by salva
in thread Unusual sorting requirements; comparing three implementations.
by tobyink
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |