in reply to readline on closed filehandle error

my $in16S = '/Users/saierlab/db/all_16S_rRNA.faa'; open (I16S,"$in16S"); my $inList = 'no'; my $genus16S = ''; while(<I16S>) {

You should verify that open worked correctly before trying to use an invalid filehandle:

my $in16S = '/Users/saierlab/db/all_16S_rRNA.faa'; open I16S, '<', $in16S or die "Cannot open '$in16S' because: $!"; my $inList = 'no'; my $genus16S = ''; while ( <I16S> ) {

Replies are listed 'Best First'.
Re^2: readline on closed filehandle error
by kielstirling (Scribe) on Jan 24, 2012 at 04:22 UTC

    I second this .. if open fails and you don't catch it the read on the filehandle when running with warnings will produce the error "readline() on closed filehandle". Good to see that you have warnings on +1 to that ;)

    Kiel R Stirling