use List::Util qw /reduce/; my @arr= qw/7 6 4 90 5 7/; my $index = reduce {$arr[$a] > $arr[$b] ? $a : $b} (0 .. $#arr); print "$index\n";
In reply to Re: How can I find the index of the biggest element in an array?
by DillonYu
in thread How can I find the index of the biggest element in an array?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |