- 论坛徽章:
- 78
|
本帖最后由 yybmsrs 于 2014-01-17 11:35 编辑
回复 15# MMMIX - Also parsed as terms are the "do {}" and "eval {}" constructs, as well
- as subroutine and method calls, and the anonymous constructors "[]" and
- "{}".
复制代码 嗯,是这样。[]和{}也是当做term来处理。
<Programming Perl>这本书里面有这么一句话,里面说了must,估计语法就是这么定义的,所以会报语法错误。- A list value may also be subscripted like a normal array. You must put the list in parentheses (real ones) to
- avoid ambiguity. Though it's often used to fetch a single value out of a list, it's really a slice of the list, so the
- syntax is:
- (LIST)[LIST]
- Examples:
- # 语法错误
- $modification_time = stat($file)[9]; # 忘记括弧了。
复制代码 |
|