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