in reply to relating arrays
Then you would do:sub best { my $d = shift; my ($best_idx) = sort { $d->[$b] <=> $d->[$a] } 0 .. $#$d; return $best_idx; }
my $idx = best(\@numbers); my $other = $data[$idx];
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|