$a,$b,$c = 1,2,3;
print "$a, $b, $c\n";
returns
, , 1
So does = (equals) take higher precedence than the tuple construction – doing this?
$a,$b,($c=1),2,3;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. There’s a precedence table in perlop. Assignment operators are level 19, and comma is level 20. In general, Perl’s operators have the same precedence as the corresponding C operators (for those operators that have a corresponding C operator).
If you meant
($a,$b,$c) = (1,2,3);you have to use the parens.