in reply to Oddness with lvalue and if/else blocks

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.

Replies are listed 'Best First'.
Re^2: Oddness with lvalue and if/else blocks
by diotalevi (Canon) on Sep 09, 2004 at 02:08 UTC

    This is easier to look at when you write /leavesublv/gvsv( "bar' ) vs /leavesublv/leave/gvsv( 'baz' ). It appears to be a bug where the return of $bar isn't generating a leave. Both conditions should trigger the warning as long as leave doesn't notice that its next op is going to be a leavesublv. So two bugs - one is that you didn't get the warning enough and one that leave isn't aware of leavesublv.

    It also looks like the fix for this makes the common case ever so slightly slower.