区别在于在标量上下文中的使用(如第二个脚本中使用- n)或在列表上下文中的使用(如第一个脚本所做的)。
The difference lies in using in scalar context (as -n does in the second script) or list context (as the first script does).
如果回调不需要参数,则我们不需要创建那个匿名列表,因为Perl按单元素数组来处理列表上下文中计算得到的数量值。
If a callback does not require arguments, we do not need to create the anonymous list, since Perl treats scalar values, evaluated in list context, as single-element arrays.
安全组件上下文中的一个值是一个列表,包含该组件所允许的0到多个元素。
A value in the context of a security component is a list of zero or more of the elements allowed by that component.
应用推荐