So the relevant parts of your code are, along with the question:
my $analysis_file = shift; open INFILE_1, '<', $analysis_file or die "Can't open '$analysis_file': $!\n"; while(<INFILE_1>) { my $ALL_FT_FILE = $_; # or some part of $_ after munging open INFILE_2, '<', $ALL_FT_FILE or die "Can't open '$ALL_FT_FILE': $!\n"; while(<INFILE_2>) { ... # is the outer $_ clobbered here? } }

That's considerably shorter, and more to the point, isn't it?

Answer: No, each $_ is localized to its own while() block. But you can't access the contents of the outer $_ from the inner block, unless you assign that to another variable.

<update>

*Sigh*. As jdporter pointed out, yes, $_ isn't localized in a while loop:

open O, '>', 'foo'; print O "bar\n"; close O; open O, '>', 'bar'; print O "$_\n" for qw(foo quux wrdlbrmfd); close O; open I, '<', 'foo'; while (<I>) { chop; open II, '<', $_ if -f $_; while (<II>) { print; } print "\$_ = '$_'\n"; } __END__ foo quux wrdlbrmfd $_ = ''

As you see at the last line of the ouput above, $_ is clobbered.

</update>

Some nits:

</pedantic> :)

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re: risk of confusion by shmem
in thread risk of confusion by steph_bow

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.