The ternary operator can be an lvalue. In that case I believe it is in void context. I don't know of any problem with using it in void context as a shorthand if..else construct, either, though I dislike to do that. ($var ? $yes : $no) = some_sub();
After Compline,
Zaxo
In reply to Re: Ternary in void context
by Zaxo
in thread Ternary in void context
by Grygonos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |