in reply to Problem with while loop
Let's take one piece of your code and rewrite it a bit:
This takes only the first line of the file. I think what you want is:open (FILE, "$file") || die "Can't open $file"; $tmp=<FILE>; foreach(split(/\t/,$tmp)){ push(@hashkeys, $_); }
This isn't meant as a definitive answer but merely a small illustrative example to help you sort out exactly what you want to domy @hashkeys; open (FILE, "$file") || die "Can't open $file"; my @lines=<FILE>; foreach my $line (@lines){ my @fields = (split(/\t/,$line){ push(@hashkeys, $fields[0]); # or perhaps it's some ot +her # field you want? }
|
---|
In Section
Seekers of Perl Wisdom