Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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?
[LanX]:  last hour of cb doesn't break
[LanX]: 12345678901234- 123456789012345678 901234567890123456 789012345678901234 567890123456789012 345678901234567890 123456789012345678 901234567890123456 789012345678901234 567890123456789012 345678901234567890 123456789012345678 901234567890123456 789012345678901234 567890

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-07-24 11:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (351 votes). Check out past polls.