in reply to 'defined' function

This assumes that the elements you want to push are at the end of the array, and that undefined ones come from the array being short.

if ($p == 1 ) { push @points, @peaks[7..$#peaks]; }
That makes use of an array slice to avoid the repetitive list of elements. The $#peaks variable is a builtin carrying the last index of the array.

(Update) The grep solutions are more general since they also work for arrays with holes in them. The last index trick is useful with them, too.

After Compline,
Zaxo