有没有理由在for循环之外的任何地方使用标量逗号运算符?
解决方法
由于Perl标量逗号是C逗号运算符的“端口”,因此
these comments可能是适用的:
Once in a while,you find yourself in
a situation in which C expects a
single expression,but you have two
things you want to say. The most
common (and in fact the only common)
example is in afor
loop,specifically
the first and third controlling
expressions. What if (for example) you
want to have a loop in whichi
counts
up from0
to10
at the same time that
j
is counting down from10
to0
?
因此,我认为,你对for循环主要有用的本能是一个很好的直觉.