I condensed your script down to the offending part. It still needs some work, but the readline warning disappeared.
#!/usr/bin/perl use strict; no strict 'refs'; use warnings; my $in16S = '/root/Desktop/pro.faa'; open I16S, '<', $in16S; my %r_genus16S; my ($genus16s) = <I16S>; while ( defined( ${'genus16S'} = readline(*I16S) ) ) { if ( $_ =~ />(\w+)\s/ ) { ${'genus16S'} = $1; } if ( exists $${'genus16S'}{ ${'genus16S'} } ) { print { 'I16S'; } $_; $${'genus16S'}{ ${'genus16S'} } = 'p'; next; } } my $no16S = 0; foreach $_ ( keys %${ 'r_genus16S'; } ) { if ( $${'genus16S'}{$_} eq 'n' ) { ++$no16S; print "$_\n"; next; } } close I16S;
In reply to Re: readline on closed filehandle error
by Khen1950fx
in thread readline on closed filehandle error
by Oapples
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |