Help for this page

Select Code to Download


  1. or download this
    sub best {
      my $d = shift;
      my ($best_idx) = sort { $d->[$b] <=> $d->[$a] } 0 .. $#$d;
      return $best_idx;
    }
    
  2. or download this
    my $idx = best(\@numbers);
    my $other = $data[$idx];