my @hashkeys; open (FILE, "$file") || die "Can't open $file"; my @lines=; foreach my $line (@lines){ my @fields = (split(/\t/,$line){ push(@hashkeys, $fields[0]); # or perhaps it's some other # field you want? }