在操作员预期的位置找到了裸字 [英] bareword found where operator expected
问题描述
我是 perl 的新手,我正在摆弄.我在网上找到了这个代码.下面是代码片段:
I am new to perl, and I am fiddiling around. I found this code online. Here is the snippet of code:
82 process_input(q,[]).
83 process_input(n,Task) :- toptask(Task), set_new_threshold.
84 process_input(s,Task) :- suggest_task(T),
85 apply(addtoagenda,T),toptask(Task).
86 process_input(x,Task) :- print('not yet implemented'),nl,toptask(Task).
87 process_input(i,Task) :- user_task,toptask(Task).
并且我收到此错误:Bareword 在process_input(n, Task"第 83 行附近找到操作员预期的位置.可能是一个失控的多行 ,, 字符串,从第 82 行开始.
And I am getting this error: Bareword found where operator expected near "process_input(n, Task" line 83. Might be a runaway multi-line ,, string starting on line 82.
推荐答案
Bareword"错误是由代码中的语法错误引起的.失控的多行"通常指出错误的开始位置,通常意味着一行尚未完成,通常是因为括号或引号不匹配.
A 'Bareword' error is caused by a syntax error in your code. A 'runaway multi-line' usually pinpoints where the start of the error is, and usually means that a line has not been completed, often because of mismatched brackets or quote marks.
正如一些 SO-ers 指出的那样,它看起来不像 Perl!Perl 解释器对语法错误犹豫不决,因为它不会说那种特定的语言!
As has been pointed out by several SO-ers, that doesn't look like Perl! The Perl interpreter is balking on a syntax error because it doesn't speak that particular language!
这篇关于在操作员预期的位置找到了裸字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!