[Bioperl-l] What happens to STDOUT?

Ryan Golhar golharam at umdnj.edu
Thu Mar 30 16:44:30 EST 2006


I'm using a simply script to reformat a genbank file to a fasta file.
Within the script, I have it print out some information.  That
information never appears in the console unless I print it to STDERR.
What happened to stdout?  Here's the script:

#!/usr/bin/perl

use strict;
use warnings;

use Bio::SeqIO;

foreach my $gbkfile(`ls *.gbk`) {
	chomp $gbkfile;
	$gbkfile =~ m/chr(\w+)/;
	my $chr = $1;

	my $fastafile = $gbkfile;
	$fastafile =~ s/gbk/fa/;
		
	print "$gbkfile...";
	my $seqin = Bio::SeqIO->new(-file => "<$gbkfile", -format =>
'genbank' );
	my $seqout = Bio::SeqIO->new(-file => ">$fastafile", -format =>
'fasta');
		
	while (my $seq = $seqin->next_seq) {
		print $seqout->write_seq($seq);
	}	
	print "\n";
}


Ryan



More information about the Bioperl-l mailing list