Sounds very much like you're trying to read a Fasta format sequence file?
You could use Bio::SeqIO, or if that is giving you problems you might try my crude Fasta load routine. It's the last code snippet in Re^5: Memory Usage in Regex On Large Sequence. That post/thread also shows a problem with the cpan module along with one reason why it's performance is not so good. Though that might have been fixed by now.
In reply to Re: How do I backtrack while reading a file line-by-line?
by BrowserUk
in thread How do I backtrack while reading a file line-by-line?
by mdunnbass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |