On Wed Oct 23 06:08:23 2013, sprout wrote: > On Sun Sep 15 11:26:14 2013, sprout wrote: > > On Sun Sep 15 09:10:35 2013, jkeenan wrote: > > > On Sun Sep 15 07:10:48 2013, sprout wrote: > > > > #!perl > > > > my @this = (); > > > > > > > > (that()) = (); > > > > print "@this\n"; > > > > > > > > sub that :lvalue { if (@this) { } else { @this; } } > > > > __END__ > > > > > > > > That gives me a bizarre copy. > > The bug is worse than that. The cases that do not get a bizarre copy do > not return assignable arrays, either: > > use Test::More 'no_plan'; > sub if119797 : lvalue { > if ($_[0]) { > @119797 > } > } > eval { (if119797(1)) = 4..6 }; > is $@, "", '$@ after writing to array returned by if'; > is "@119797", "4 5 6", 'writing to array returned by if'; I have fixed both those issues in commit 2ec7f6f242. But it turns out that bare blocks exhibit similar problems. I will probably fix that tomorrow. Also, should while and for loops be able to return lvalues? I have always been confused as to whether the last statement inside a loop can be implicitly returned, so I have simply avoided depending on that. I don’t know the answer here. -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org:443/rt3/Ticket/Display.html?id=119797Thread Previous | Thread Next