http://qs321.pair.com?node_id=1085370

lomSpace has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm getting the following error message, ~/Desktop/Pipelines/hypothetical50.pl:7: readline() on closed filehandle $in. I can get the data to stdout, which is fine for my pipeline, but I would also like to have the actual file. Thank you PerlMonk for you infinite wisdom! Here's the code:

#!/usr/bin/perl -w use strict; open(my $in,"/Users/Desktop/Pipelines/fungi.1.aa.hypothetical.faa"); open(my $out,">Users/Desktop/Pipelines/fungi.1.aa.hypothetical50.faa") +; local $/ = undef; my @chunks = split(/>/, <$in>); my @hypothetical50 = @chunks[0..49]; for my $hypothetical50(@hypothetical50){ if($hypothetical50 =~ s/^gi/>gi/g){ print $out "$hypothetical50\n"; } } close($in); close($out);