in reply to Re: Question about ternary operator
in thread Question about ternary operator

The problem is that the assignment has a looser precedence than the ternary op.

Shouldn't then the OP's program had reported a syntax error?

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: Question about ternary operator
by moritz (Cardinal) on Jul 01, 2009 at 11:54 UTC
    No:
    $ perl -MO=Deparse,-p -e '1 ? $a = 3 : $b = 4' (($a = 3) = 4); -e syntax OK

    You see it is parsed, not just the way you'd naively expect it.