Help for this page

Select Code to Download


  1. or download this
    @sorted_els = map  { $_->[0] }
                  sort { $a->[1] <=> $b->[1] }
                  map  { [$_, complex_calculation($_)] }
                  @list;
    
  2. or download this
    # swapped $a/$b to get max
    ($max_el) = map  { $_->[0] }
                sort { $b->[1] <=> $a->[1] }
                map  { [$_, complex_calculation($_)] }
                @list;