changed if ( defined $refseq_io ) to if ( !defined $refseq_io ), otherwise it could not open the file