首页 > 解决方案 > “连续两个术语”错误

问题描述

我正在尝试编写如下的紧凑行,代码是从使用动态范围的特殊变量 $*IN 读取 STDIN 的脚本的摘录。你能告诉我如何正确地写这行吗?

这有效

for $*IN.lines() {
    last when "" ;
    say "VERBOSE \"$_ is the string\"";
    $i=$i+1;
}

不工作

.say "VERBOSE \"$_ is the string\"" for $*IN.lines() last when "";

错误输出:

===SORRY!=== Error while compiling /usr/share/asterisk/agi-bin/agi-t1.p6
Two terms in a row
at /usr/share/asterisk/agi-bin/agi-t1.p6:5
------> .say⏏ "Verbose \"$_\"" for $*IN.lines() last
expecting any of:
  infix
  infix stopper
  statement end
  statement modifier
  statement modifier loop

标签: compiler-errorssyntax-errorraku

解决方案



推荐阅读