First, don't use Perl. It's not for someone like you. Use Python. There is a reason why it's so widely used - it's MUCH more resistant to attempts to write horrible garbage code like yours. Python is especially suitable for scientists and other non-programmers (it's ok for programmers also).
For one thing (as already mentioned), the line
open OUT,'>'."$path/$name.faa" || die ("cannot open out $file $!\n");
isn't parsed like you think it is, due to precedence of operators. Specifically, || has higher precedence than comma, so it's parsed like
open OUT, ('>'."$path/$name.faa" || die ("cannot open out $file $!\n" +));
This will never die.
Second - I suppose that's the real problem - you(?) are setting the global variable $/
$/ = "\>";
and then never restoring it back to "\n". I don't see how "it reads the other lists and tell how many od each list's ID are found in the FASTA file" is possible. You're probably confused.
There is more, albeit relatively harmless (like not resetting $found or chomping stuff from @lista twice). Not even to mention broken indentation. It seems the script consists of two parts, the first part (ending with chomp(my @data = <INFILE>) is old school, but relatively reasonable, the next part is yours.
Anyway, Guido was right and Larry failed.
In reply to Re: Extract multiple lists od Identifiers from a FASTA file
by Anonymous Monk
in thread Extract multiple lists od Identifiers from a FASTA file
by joluito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |