http://www.perlmonks.org?node_id=617760


in reply to How can I find the index of the biggest element in an array?

my $i = $#data; my $max = $i; $max = $data[$i] > $data[$max] ? $i : $max while $i--; print "Max value is $data[$max], at index $max\n"