【发布时间】:2020-01-29 20:04:39
【问题描述】:
我在一本书中遇到过一段代码,看起来像这样:
#for (some_condition) {
#do something not particularly related to the question
$var = $anotherVar+1, next if #some other condition with $var
#}
我不知道 $anotherVar+1 和 next 之前的逗号 (",") 有什么作用。这种语法结构是如何调用的,它是否正确?
【问题讨论】:
-
你的意思是comma operator?您可以将它用作备用语句分隔符,这似乎是这里发生的事情,但这不是最好的主意。请改用
;和新语句。