Actually, the use of @data will read each remaining line of the filehandle into an array element of @data. The code below illustrates this (assuming that the file test.pl exists in the directory where the code is run):
#!/usr/bin/perl -w
use strict;
open(TEST,'test.pl');
my @test = <TEST>;
my $line_number = 0;
foreach (@test) {
++$line_number;
print "$line_number: $_";
}