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.
It'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.
> 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).
...because it's an array value? Aside from how the languages handle references, how is that part any different from, for example, this in python:
You can put (almost) anything there, as long as it's an expression that evaluates to a value. The resulting value is what goes into the array.