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";