added my $bp = $seq->length; $contig->length($bp);
added
my $bp = $seq->length;
$contig->length($bp);

changed $contig->seq($seq) to $contig->seq($seq->seq);

Ensembl/ensembl-pipeline,Ensembl/ensembl-pipeline,Ensembl/ensembl-pipeline