On Mon Sep 06 05:57:18 2010, davem wrote: > I'm marking this ticket as rejected/wontfix, because no-one can agree on > whether for() should auto-vivify, and if there was agreement, changing > it would break backwards compatibility. I have just discovered this ticket, as there is a to-do test for it, which I found when about to add a test for #115194 (a duplicate). I did not realise this was so controversial. The problem here is that I broke compatibility (and App::JobLog) when making foreach(pos $x || pos $y) work (by propagating the lvalue context to allow $_ assignment to set pos). Now foreach($h{k} || $h{l}) vivifies the elements, whereas it did not before. The obvious solution seemed to be to use defelem magic in foreach, as we already do for sub calls. Come to think of it, this has already been inconsistent, as constant folding will make for(1||$h{k}) vivify even before my changes. So I think we need to bite the bullet and decide that this is a bug that needs fixing. -- Father Chrysostomos --- via perlbug: queue: perl5 status: rejected https://rt.perl.org/Ticket/Display.html?id=2166Thread Next