... my @lines = readdata(); foreach my $line (@lines) { my @fields = split ' ', $line; print $fields[2]; } ...