in reply to Re^6: (RFC) Arrays: A Tutorial/Reference
in thread (RFC) Arrays: A Tutorial/Reference
This is a special case documented in perlop under Assignment Operators and, I think, perldata documents () as the literal null list. Your description seems correct to me.$c = ( () = /\w+/g );
() = ("head", "tail"); @ar = ( "head", "tail"); ($head, $tail) = ( "head", "tail" );
Lead us, in notational way, to accepting or expecting the behaviour of
but I don't think I've seen this documented. Here the parenthesis do make a list of the assignment's LHS. It is too easy to think that the LHS of an assignment operation is effected by the enclosing context, when we should realize that the context of an assignment op's LHS is self-determinant. That is the similarity with the repetition operator.($head) = ( "head", "tail" );
Be well,
Rob
|
|---|