Well, I am not sure of the exact nature of your problem from
you description, but I would clean up a few stylistic things,
and maybe along the way your problem will clear up too.
First, when reading in a file you can either do it in a while
loop, in which case it will read in line by line, or you can
slurp it all at once by assigning the filehandle to an array
(each line becoming an element of the array). You've done
a hybrid of both here, and that may be the source of your problem.
Most people agree that the way to go is to read line by line,
that way if you get an input file that is bigger than you expect,
you don't pay any penalties for slurping a huge file into memory.
Also, since you are reading the file in line by line, you can
do the rest of the work in the while loop, resulting in:
print "\nPROCESSING file $file...\n";
while (<FILE>) {
chomp $_;
$accession = $_;
etc....I have made the necessary corrections now
}
If you desided you don't want to do it that way, I would at
least change your for loop to a more Perlish loop:
foreach my $accession(@acc) {
chomp $accession;
etc....I have made the necessary corrections now
}
Good luck,
Scott