Found word where operator is expected

I am new to perl and I play around. I found this code on the Internet. Here is the code snippet:

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). 

And I get this error: Bareword found where the operator was waiting near the line "process_input (n, Task" 83). May be a running multi-line line starting at line 82.

+6
perl prolog
source share
1 answer

The "Bareword" error is caused by a syntax error in the code. A β€œrunning multi-line line” usually indicates where the error starts, and usually means that the line was not completed, often due to inconsistent brackets or quotation marks.

As noted by several SO servers, this is not like Perl! The Perl interpreter discards a syntax error because it does not speak this particular language!

+9
source share

All Articles