in reply to How to find the N largest values in an array?

If you mean "the three consecutive values that when summed make up the highest total", then that gives an implementation strategy:
my $where = 0; my $sum = $num[0] + $num[1] + $num[2]; for ( 1 .. $#sum-2 ) { my $try = $num[$_] + $num[$_+1] + $num[$_+2]; if ( $try > $sum ) { $try = $sum; $where = $_; } }