http://www.perlmonks.org?node_id=943930


in reply to Surprised by Perl parse of ternary operator

It is indeed a bit weird since ?: has higher precedence than =: respective precedence levels 18 and 19, see Operator Precedence and Associativity.

I guess that the perl parser is a bit of a smart-ass here, as bending the precedence rules a little will allow the expression to get successfully parsed, instead of producing an unhelpful syntax error.