@h{@a}++ ?

vsergu on 2002-01-20T22:50:01

Someone on DC.pm who was trying to understand slices has run across something odd. Autoincrementing a hash slice (or for that matter autodecrementing an array slice) is not a syntax error. It increments the last element in the slice and autovivifies the others, at least in 5.6.1 and 5.005_03. There's now disagreement on the list about whether it's a bug. Does it make any sense to anyone else?

It may be related to something else that does seem to have been a bug, since it was fixed: ($a, $b, $c)++ isn't a syntax error in 5.005_03 but it is in 5.6.1.