use strict; use warnings; use Bio::SeqIO; my $in = Bio::SeqIO->new( -file => 'file1.fasta', -format => 'Fasta' ); my $out = Bio::SeqIO->new( -file => '>file2.fasta', -format => 'Fasta' ); while ( my $seq = $in->next_seq() ) { my $newSeq = Bio::Seq->new( -display_id => $seq->id, -seq => 'aaaa' . $seq->seq ); $out->write_seq($newSeq); } #### >dddd aaaaabcdef >eeee aaaabcdef #### 'aaaa' . $seq->seq