If you add a warn or some other statement, it happens in both cases. I'm currently trying to see if anything in the B::Concise output is an indication.

Update: this is the result, reduced to its relevant bits:

$ perl -MO=Concise,-tree t.pl # from your code verbatim: # ... |-scope-+-ex-nextstate | `-ex-rv2sv---<4>gvsv(*bar) `-<9>leave-+-<6>enter |-<7>nextstate(main 2 t.pl:11) `-ex-rv2sv---<8>gvsv(*baz) # after adding warns # ... |-<i>leave-+-<c>enter | |-<5>nextstate(main 1 t.pl:7) | |-<7>warn[t1]---<6>pushmark | |-<8>nextstate(main 1 t.pl:8) | `-ex-rv2sv---<9>gvsv(*bar) `-<i>leave-+-<c>enter |-<d>nextstate(main 2 t.pl:12) |-<f>warn[t2]---<e>pushmark |-<g>nextstate(main 2 t.pl:13) `-ex-rv2sv---<h>gvsv(*baz)

As you see, the truth-branch of your condition works in the cases where the compiler doesn't set up a complete scope for it for whatever reason.

Don't ask me exactly why that is a problem and what this all means, yet. :-)

Makeshifts last the longest.


In reply to Re: Oddness with lvalue and if/else blocks by Aristotle
in thread Oddness with lvalue and if/else blocks by BUU

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.