Closed
Description
When assigning to a hash, an even-sized list is required. If an odd-sized list is presented, perl prints a warning:
my %h = (1, 2, 3);
Odd number of elements in hash assignment at (eval 7) line 1.
The new n-at-a-time foreach
syntax never gives a warning in similar circumstances:
use experimental 'for_list'; foreach my ($k, $v) (1,2,3) {}
# no warning
Perhaps it should? It can't be worded quite the same way, because "odd vs even" is only a useful concept for n=2. But perhaps some wording such as:
Insufficient elements for final bundle of foreach list at ...