in reply to relating arrays

You want to keep track of the indices, not the actual element. If, for example, your "best" routine were simply the max-function:
sub best { my $d = shift; my ($best_idx) = sort { $d->[$b] <=> $d->[$a] } 0 .. $#$d; return $best_idx; }
Then you would do:
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:??;