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

有没有理由在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循环主要有用的本能是一个很好的直觉.

相关文章

1. 如何去重 #!/usr/bin/perl use strict; my %hash; while(...
最近写了一个perl脚本,实现的功能是将表格中其中两列的数据...
表的数据字典格式如下:如果手动写MySQL建表语句,确认麻烦,...
巡检类工作经常会出具日报,最近在原有日报的基础上又新增了...
在实际生产环境中,常常需要从后台日志中截取报文,报文的形...
最近写的一个perl程序,通过关键词匹配统计其出现的频率,让...