加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Perl的标量逗号运算符何时有用?

发布时间:2020-12-15 21:46:22 所属栏目:大数据 来源:网络整理
导读:有没有理由在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 t
有没有理由在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 a for loop,specifically
the first and third controlling
expressions. What if (for example) you
want to have a loop in which i counts
up from 0 to 10 at the same time that
j is counting down from 10 to 0?

因此,我认为,你对for循环主要有用的本能是一个很好的直觉.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读