OK, here's what I'm thinking.
$Body .= $_ while <LOG>;
is equivalent to
while ($_ = <LOG>) { $Body .= $_; }
Therefore, $_ is both an L-value and an R-value. If we assume for a moment that $_ is somehow an alias for $g::TaskList, then it should be correct that for each iteration of the while loop, $_ (and thus $g::TaskList) will get assigned the next line from <LOG>. At the end of the while loop, what would happen to $_? Would it get undef'd? Would this undef any aliases? So, let's assume all this is true... Here is my code path:
In Localize.pm: (SNIP) foreach my $lang (@g::LanguageList) { $g::Language = $lang; unless (isExcludedBuild($g::Product, $g::Architecture, $g::Flavor) + || $g::Architecture =~ /ia64/i || $g::Language =~ /usa/i) { (SNIP) &BuildBlah(); } } (SNIP) In Utilities.pm: sub BuildBlah { my $FlavorVariation = shift; (snip) if(FileExists("Blah")) { SendMail($g::MailPurpose{"BuildFailed"}, "Blah", $FlavorVariat +ion); } (snip) } In Reporting.pm: sub SendMail { my $Purpose = shift; my @OptionalParameters = @_; my $Body = ""; (snip) $Body = "<html> <body background=nothing bgproperties=\"fixed\">"; if($Purpose eq $g::MailPurpose{BuildNominated}) { (snip) } elsif($Purpose eq $g::MailPurpose{BuildFailed}) { (snip) open(LOG, "$LogDir\\$g::BuildErrFile"); while (my $line = <LOG>) { $Body .= "${line}<br>"; } close LOG; }
Although I've snipped a lot of code, this follows the execution path, and you can see that $g::TaskList is never mentioned going way way back up through several loops, modules and subroutine calls. Do I need to backtrack further? I would think the foreach above would wipe out any alias of $_ to TaskList that might have been set higher up in the stack trace.

In reply to Re^3: Side Effects by goodgulf
in thread Side Effects by goodgulf

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.