On Sun Sep 15 09:10:35 2013, jkeenan wrote: > On Sun Sep 15 07:10:48 2013, sprout wrote: > > On Sun Sep 15 06:21:00 2013, jkeenan wrote: > > > ########## > > > $ cat 119797-lvalue.pl > > > my @this = (1..5); > > > > > > (that()) = (); > > > print "@this\n"; > > > > > > sub that :lvalue { if (@this) { } else { @this; } } > > > ########## > > > $ perl 119797-lvalue.pl > > > 1 2 3 4 5 > > > ########## > > > > > > I don't think there is a bug here. > > > > Your version puts something in the array, avoiding the else block. > > > > Try this: > > > > #!perl > > my @this = (); > > > > (that()) = (); > > print "@this\n"; > > > > sub that :lvalue { if (@this) { } else { @this; } } > > __END__ > > > > That gives me a bizarre copy. > > > > > Okay. So now we should ask: How significant is this bug? It’s low priority, as the workaround (explicit return) is simple. > What can we > do to fix it? I suspect skipping the leave op when followed by leavesublv would work. In fact, skipping it for any sub (not just lvalue) would probably make implicit return faster in general. That would entail nulling it (via op_null(...)) in S_finalize_op in op.c. (That’s without looking at the code, so it could be all wrong.) -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org:443/rt3/Ticket/Display.html?id=119797Thread Previous | Thread Next