Re: perl "alternating foreach" feature idea



On Feb 25, 10:25 am, Sherm Pendley <spamt...@xxxxxxxxxxx> wrote:
"Erik 2.0" <e...@xxxxxxx> writes:

foreach ($key, $val) in (@pairs) {
print "$key=$val\n";
}

an odd number of values in @pairs would cause an extra iteration with
$val set to undef

Great idea! When you've implemented it, you should send your patch to p5p
to get it integrated with mainline Perl.

I think this sort of thing in the core language is bloat. IIRC this
particular bloat is in Perl6. IMHO this is a case where we should have
KISS.

.



Relevant Pages