hello all, i'm trying to do something simple, but i was hoping there might be an easy and efficient way to do it. i'm currently using sort to find the max value in an array:
my $max = (sort {$b <=> $a} @y)[0];
but i'm wondering if there is a way to get sort (or some other built in function) to return the original index of this value. right now i have a naive for loop doing the job, and i need to speed it up and was hoping to avoid writing a more efficient search routine myself.
thanks,
JR