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

Re (tilly) 1: Golf: Arbitrary Alphabetical Sorting

by tilly (Archbishop)
on May 09, 2001 at 21:30 UTC ( [id://79177]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub o{
    ($c,$s)=@_;@m{@$c}=map{10*@$c+$_}0..@$c;sub t{$_=pop;s/./$m{$&}/gs;$_}
    +sort{t($a)cmp t($b)}@$s
    }
    
  2. or download this
    sub o{
    ($c,$s)=@_;@m{@$c}=map{$_+9999}1..@$c;sub t{$_=pop;s/./$m{$&}/gs;$_}so
    +rt{t($a)cmp t($b)}@$s
    }
    
  3. or download this
    sub o{
    ($c,$s)=@_;@m{@$c}=map$_+9**9,1..@$c;sub t{$_=pop;s/./$m{$&}/gs;$_}sor
    +t{t($a)cmp t$b}@$s
    }
    
  4. or download this
    sub o{
    ($c,$s)=@_;@m{@$c}=map$_+1e9,1..@$c;sub t{$_=pop;s/./$m{$&}/gs;$_}sort
    +{t($a)cmp t$b}@$s
    }
    
  5. or download this
    sub o{
    ($c,$s)=@_;@m{@$c}=map$_+~0,1..@$c;sub t{$_=pop;s/./$m{$&}/gs;$_}sort{
    +t($a)cmp t$b}@$s
    }
    
  6. or download this
    sub o{
    ($c,$s)=@_;@m{@$c}=1e8..@$c+1e8;sub t{$_=pop;s/./$m{$&}/gs;$_}sort{t($
    +a)cmp t$b}@$s
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 00:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found