http://www.perlmonks.org?node_id=450783


in reply to Some Insights from a Traveler Between Languages

Would you have such conceptual trouble if the syntax were instead:

store_into( array_foo, list_of_values (1, 2, 3) ); store_into( scalar_bar, array_reference( list_of_values( 1, 2, 3 ) ); store_into( scalar_baz, last_expression_of_list( 1; 2; 3; ) ); store_into( array_biz, array_reference( list_of_values( 1, 2, 3 ) );

I'm not suggesting that's great syntax or that it's even clear syntax, but I am suggesting that that's effectively the way you have to think about the code if you want to understand what it's doing. (That also explains why your interpretation of the third case is incorrect.)

Is it inconsistent? I don't think so. All four are doing different things and all four look very different. As you suggest, it's similar to the difference between Python tuples (immutable) and lists (mutable). They may look similar if you don't pay attention to the brackets, but they look different because they behave differently.