7
votes

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

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.

1
are you sure its Perl that you are fiddling around with?Eric Strom
Agreed, that looks more like prolog.Ether
AFAIK both prolog and perl use ".pl" as their extension, that's probably the source of the confusion.mu is too short

1 Answers

9
votes

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.

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!