in reply to How to avoid using array in concatenating string of multiple lines OR How To Read FASTA

You can also use Bio::FASTASequence::File:
use Bio::FASTASequence::File; my $file = '/path/to/seq.fa'; my $obj = Bio::FASTASequence::File->new($file); my $result_ref = $obj->get_result(); my $counter = 1; foreach(keys(%{$result_ref})){ print $counter,": ",$result_ref->{$_}->getSequence(),"\n"; $counter++; }


You sequences:
>Seq1 (two lines) AAAAAAAAAAAAA CCAAAAAAAAAAA >Seq2 (two lines) AAAAAAAAAAAAA AAAAAAAAAAAAA >Seq3 (one line) TTTTTTTTTTTTAACTGAAGATTCGC