Update: forget it, I said nonsenses.
To add to ikegami's comment, it seems that in many places, you need explicit () to use lvalue functions. And this is how it is used in the examples given in perlsub (Lvalue subroutines). In simple pieces like if (META_HIDDEN) or META_EXT;, they don't look very ambiguous. So that Perl does the right thing. But things like META ? a : b, where META is lvalue, give a bad time to the interpreter. See:
$ perl -MO=Deparse -e 'sub META : lvalue { $a } META ? a : b ' Search pattern not terminated or ternary operator parsed as search pat +tern at -e line 1. sub META : lvalue { $a; }
There in the docs, there's a warning about the experimental status of lvalue subroutines and how their drawbacks (like violating encapsulation) can made them not such a good idea.
In reply to Re: funky error using lvalue subs in ternary assignment?
by ferreira
in thread funky error using lvalue subs in ternary assignment?
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |