my $seqio = Bio::SeqIO->new(-format => $seqformat, -file =>$filename); while( my $seq = $seqio->next_seq ) { print "seq name is ", $seq->display_id, " desc is ", $seq->description(), "\n"; print "sequence is ", $seq->seq(), "\n"; } #### my $fh = Bio::SeqIO->newFh(-format =>$seqformat, -file =>$filename); while(<$fh>) { my $seq = $_; # do as before } #### my $fh; open($fh, "cat seqfile |") ||die $!; my $seqio = Bio::SeqIO->new(-format => $seqformat, -fh => $fh); # OR retrieve a sequence from the blast formatted db 'nt' # by GI number open(IN, "fastacmd -d nt -s 3264957 |") ||die $!; my $seqio = Bio::SeqIO->new(-format => 'fasta',-fh => \*IN); while( my $seq = $seqio->next_seq ) { #and so forth.... }