in reply to I can't find my mistake here!!!

  1. use strict;
  2. use warnings;
  3. Unmatched parans in if (($sequence
  4. Use the "3 argument" open with a scalar filehandle (no bareword).
  5. You don't need ">" in the print statement, this would be more clear to you if you used 3 argument open.
  6. You can skip the parens in close.
  7. If you are only writing in the case of /ABC/, just open and close inside of the if statement.

Replies are listed 'Best First'.
Re^2: I can't find my mistake here!!!
by choroba (Cardinal) on Jul 02, 2014 at 11:59 UTC
    You don't need ">" in the print statement
    You do, if your output is in the FASTA format.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Ah, tricky. I was just trying to cover all of my bases (pun intended). =)
      Ok, something came up:
      It seems to work, if I do the open, within the if block... Any ideas why? But in that case it's not helpful because later on I will have to open it again, and all this open file it not time-efficient, right?

        Maybe you are overwriting your file twice in your program.

        I think you will have to show the code. Please reduce it to a self-contained program of no more than 20 lines that still reproduces the problem.

        Hi again,
        I think I solved it, I create a temporary hash and use it later on and now it prints OK... It must be some silly mistake that I am making, but I don't have time to bother more now...
        Many sincere thanks to all of you that were kind enough to try to guess what my stupid error is :)