我正在尝试编写如下的紧凑行,代码是脚本的摘录,该脚本使用动态范围的特殊变量$*IN读取STDIN.你能告诉我如何正确写这条线吗?
这有效
for $*IN.lines() {
last when "" ;
say "VERBOSE \"$_ is the string\"";
$i=$i+1;
}
Run Code Online (Sandbox Code Playgroud)
.say "VERBOSE \"$_ is the string\"" for $*IN.lines() last when "";
Run Code Online (Sandbox Code Playgroud)
错误输出:
===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
Run Code Online (Sandbox Code Playgroud)