Good answer! Allow me to supply the missing puzzle piece.
"That’s just my guess as to what is going on. I don’t know where the && in the error message is coming from"
The following two statements are logically equivalent:
# logical and foo() && bar(); # postfix if bar() if foo();
The Perl parser in fact compiles them to the same optree. You can see this by running the following commands:
$ perl -MO=Concise -E'foo() && bar();' $ perl -MO=Concise -E'bar() if foo();'
After Perl has finished parsing the statement and has built its optree, it "forgets" the code which it originally saw. When it needs to generate an error message, it has to take a guess at whether the error message should talk about "if", "&&", or indeed "and" — in this case, it's gotten it wrong.
Linda doesn't have any "&&" operators in her code, but she does use the postfix "if" in some places, and it's this which is being complained about by Perl.
As an aside, for a much easier way of writing lvalue subs, take a look at LV.
In reply to Re^2: weird error message in middle-aged-perl(5.14)
by tobyink
in thread weird error message in middle-aged-perl(5.14)
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |