3 ms·
I understand that's constructing an array. What's a bit odd is that the interpreter allows you to string interpolate any expression when constructing the array
by autarch 2y ago
I understand that's constructing an array. What's a bit odd is that the interpreter allows you to string interpolate any expression when constructing the array reference inside the string.
- Izkata 2y agoIt's not...? Well, not directly: It's string interpolating an array of values, and the array is constructed using values from the results of expressions. These are separate features that compose nicely.
- JadeNB 2y ago> What's a bit odd is that the interpreter allows you to string interpolate any expression when constructing the array reference inside the string. Why? Surely it is easier for both the language and the programmer to have a rule for what you can do when constructing references to anonymous arrays, without having to special case whether that anonymous array is or is not in a string (or in any one of the many other contexts in which such a construct may appear in Perl).