I haven't yet worked out what you are doing with the @two array but here is what I have working so far.
#!perl
use strict;
use warnings;
use autodie;
use Bio::SeqIO;
STDOUT->autoflush(1);
my $gbffpath = 'your path';
opendir DIR, $gbffpath;
my @files = grep {/\.gbff$/ } readdir DIR;
closedir DIR;
foreach my $gbfffile (@files){
my $in = Bio::SeqIO->new(-file=>$gbffpath.'/'.$gbfffile,
-format=>"genbank");
my $obj = $in->next_seq();
my @feat = $obj->get_SeqFeatures();
my $start = 0; my $length = 9;
foreach my $n (0..$#feat){
my $pt = $feat[$n]->primary_tag();
$start += $feat[$n]->start();
my $end = $start + $length;
my $subseq = $obj->subseq($start,$end);
printf "%2d %-10s %2d %2d %s\n",$n,$pt,$start,$end,$subseq;
$start = $end;
}
}
poj