Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Unusual sorting requirements; comparing three implementations.

by salva (Abbot)
on Oct 24, 2012 at 12:45 UTC ( #1000626=note: print w/ replies, xml ) Need Help??


in reply to Unusual sorting requirements; comparing three implementations.

keysort is an XS implementation of the Schwartzian transform
Well, 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..$#_]; }


Comment on Re: Unusual sorting requirements; comparing three implementations.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000626]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (18)
As of 2015-07-28 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls