in reply to Re: check for contiguous row values
in thread check for contiguous row values

Not quite - you exit before outputting the final line. You need to add another line to flush @data, e.g.:

print $FILE "$data[0]\t$data[-1]\t", scalar @data, "\n" if @data > 1;

after the while loop. This depends on how your file is terminated - your code will function correctly if it is terminated with two or more newlines.