in reply to Re: Manipulating tab delimited file
in thread Manipulating tab delimited file
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 $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Manipulating tab delimited file
by Laurent_R (Canon) on Apr 29, 2016 at 06:25 UTC | |
|
Re^3: Manipulating tab delimited file
by Athanasius (Archbishop) on Apr 30, 2016 at 06:11 UTC |