compiler-errors - “连续两个术语”错误
问题描述
我正在尝试编写如下的紧凑行,代码是从使用动态范围的特殊变量 $*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
解决方案
推荐阅读
- c# - Telerik MVC 星级评定,调整星星大小
- c# - 如何在 Xamarin.Forms 的 Listview 中保持计时器的状态
- python - 如果条件应该返回真,但返回假
- c# - 如果使用了 FieldOffset,必须在每个类/结构成员上使用它吗?
- django - 在我的 Django 应用程序中实现用户类型限制
- python - keras - 使用嵌入层检查目标时出错
- apache - apache中的vhost重写规则-摆脱子域而不重定向
- javascript - 为什么当值为 0.5 时 Math.round() 不四舍五入?
- mysql - Debian 10 MariaDB '无法通过套接字'/var/run/mysqld/mysqld.sock' (2) 连接到本地 MySQL 服务器'
- java - Java中String的compareTo方法