You've got an answer to your problem as stated, but there's another problem lurking in that code fragment: you're trashing the variable that holds the original lines. I highly recommend that you put the results of split into a different variable.
foreach my $line ( @file ) {
my @fields = split(/\s+/, $line);
print "$fields[2]\n";
}
avoids future problems.