my $index = 0; my $big = $STD[0]; for my $i (1..$#STD) { if ($big < $STD[$i]) { $index = $i; $big = $STD[$i]; } }