Help for this page

Select Code to Download


  1. or download this
    my @sortedarray = sort @unsortedarray;
    
  2. or download this
    my @sortedarray = @unsortedarray[sort @unsortedarray];
    
  3. or download this
    my @sorted = @unsorted[ map {$$_[1]} 
                            sort {$$b[0]<=>$$a[0]}
                            map [expensive($unsorted[$_]), $_]; } 
                            0..$#unsorted ];