Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
[Lady_Aleena]: Bw, happy Turing day!

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-06-23 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (539 votes). Check out past polls.