Can someone explain to me why this is. Is the ternary operator some kind of list operator in disguise? Why does the context of shift need to be so explicit.
if someone can point to the book that explains this, I would be greatful, otherwise it's a bug in my eyes because '?' is an operator and the interpretor upon hitting that operator as such and not a token should decipher the context of the shift.# WRONG! at least in 5.8.5 - context is ambiguous? my $thing = shift ? 1: 0 #RIGHT! $thing = shift() ? 1 : 0
Dec 19, 2025 at 00:29 UTC McDarren Moved from Snippets Section to SOPW
In reply to Use of shift in Ternary Operator by cheruvim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |