in reply to 'defined' function

It depends on how you want to deal with the empty elements, but a grep should do the job there e.g
push @points, join ' ', grep defined, @peaks[7 .. 13];
See. the grep docs for more info.
HTH

_________
broquaint