this is a section of code I am trying to write. Is there a way to make the variable my $temp that was used in the while loop also available in the open filehandle statement? The code works OK till close (FASTQIN);. the error reads:while( defined(my $head = <FASTQIN>) && defined(my $seq = <FASTQIN>) && defined(my $qhead = <FASTQIN>) && defined(my $quality = <FASTQIN>) ){ substr($head, 0, 1, '>'); my $temp = print $head, $seq; } close (FASTQIN); my %count_seq; open my $fh, '<:encoding(UTF-8)', $temp or die "Cannot open $temp +$!"; while (<$fh>) { chomp; next if /^>/; next if length($_) > 30 or length($_) < 15; $count_seq{$_}++; }
Line 44 is this:Use of uninitialized value $temp in open at test.pl line 44. Use of uninitialized value $temp in concatenation (.) or string at tes +t.pl line 44. Cannot open No such file or directory at test.pl line 44.
Kindly advise, monks! Thanks!open my $fh, '<:encoding(UTF-8)', $temp or die "Cannot open $temp $!";
In reply to Re^2: Manipulating tab delimited file
by andyBio
in thread Manipulating tab delimited file
by andyBio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |