in reply to Error opening file handle within while loop

Missing a semicolon in the print statement immediately prior to opening IN2.

Why do you need to re-open OUT1?

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

  • Comment on Re: Error opening file handle within while loop

Replies are listed 'Best First'.
Re^2: Error opening file handle within while loop
by rjc33 (Sexton) on Feb 10, 2016 at 12:53 UTC

    Wow, that was obvious! Apologies for missing such a mistake, and thanks for your answer.

    OUT1 is re-opened just to clear it's contents, then it is re-filled with the next section of the file I need to analyse. I'm not sure this is the best way of doing this, but it seems to work.

    Now I've added that missing ;, I'm getting an error message: Use of uninitialized value $columnsA2 in addition (+) at phastCons_multiples_ids3.pl line 19

    I'm not sure why this is, it's declared within the first if statement?
      Also, apologies but ignore that it says $columnsA, just a discrepancy between the script I'm currently testing and the one I've posted here.

        Presumably you fixed this error also

        my $mafBlock = qx(maf_parse --start $start --end $end $maf); print OUT1 "$mafBlock1\n"; # << should be $maxBlock
        poj