Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Unusual sorting requirements; comparing three implementations.

by salva (Monsignor)
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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-07-31 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (254 votes), past polls