in reply to using flags

Well, once you set $in_gene to 1, it never gets set to a false value again. Try adding a my $in_gene; at the beginning of the loop.

Abigail

Replies are listed 'Best First'.
Re: Re: using flags
by Anonymous Monk on Oct 07, 2003 at 14:21 UTC
    the problem is that I need this variable outside of the loop too..... any other ideas?
      If you need the variable, that's not a problem as using 'my $in_gene' just creates a different $in_gene for the loop. If you need the value, you'll have to use 2 variables, one to signal that there was a match somewhere (which is what $in_gene is doing right now), and one that signals a match at the current iteration. For that, a lexical variable will be perfect.

      Abigail