AK
Size: a a a
AK
OP
OP
AK
AK
n
n
AK
n
n
AK
b
my @a = 1,,3
эквивалентно my @a = 1,undef,3
. Оказывается, нет. Запятые схлопываются. Почему так?AP
AP
AP
AP
AP
b
AP
c
my @a = 1,,3
эквивалентно my @a = 1,undef,3
. Оказывается, нет. Запятые схлопываются. Почему так?This interpolation combines with the facts that the opening and closing parentheses are optional (except when necessary for precedence) and lists may end with an optional comma to mean that multiple commas within lists are legal syntax. The list 1,,3 is a concatenation of two lists, 1, and 3, the first of which ends with that optional comma. 1,,3 is (1,),(3) is 1,3 (And similarly for 1,,,3 is (1,),(,),3 is 1,3 and so on.) Not that we'd advise you to use this obfuscation.