Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re (tilly) 1: Golf: Arbitrary Alphabetical Sorting

by tilly (Archbishop)
on May 09, 2001 at 21:30 UTC ( #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
Node Status?
node history
Node Type: note [id://79177]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-09-21 17:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (173 votes), past polls