Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 chanting in the Monastery: (6)
As of 2014-09-21 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (171 votes), past polls