The following code snippet shows that if Bio::PrimarySeq->subseq() is called with a replacement sequence, it doesn't update the sequence to adapt to a change in its length after the subsequence is replaced.
my $s = Bio::PrimarySeq->new( -seq => "ABBBA" );
print "Initial sequence: " . $s->seq . "; len: " . $s->length ."\n";
$s->subseq(2,4, 0, "CCCCCCC" );
print "Modified sequence: " . $s->seq . "; len: " . $s->length ."\n";
The output is:
Initial sequence: ABBBA; len: 5
Modified sequence: ACCCCCCCA; len: 5