in reply to Surprised by Perl parse of ternary operator

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 :)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?