Help for this page

Select Code to Download


  1. or download this
    use List::Util qw /reduce/;
    
    ...
    my $index = reduce {$arr[$a] > $arr[$b] ? $a : $b} (0 .. $#arr);
    
    print "$index\n";