Running this line of code through MO=Deparse produced the same output.
Add -p to show the precedence:
c:\test>perl -MO=Deparse,-p -e"$fred == 42 ? $config = 'k1' : $config += 'k2';" ((($fred == 42) ? ($config = 'k1') : $config) = 'k2'); -e syntax OK
(And yes. It's weird :)
In reply to Re: Surprised by Perl parse of ternary operator
by BrowserUk
in thread Surprised by Perl parse of ternary operator
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |