Because of precedence
(1 ? $a = 2 : $b) = 'x'; [download]
You didn't read your "perldoc perlop" ...
In reply to Re: ternary conditional help by tybalt89 in thread ternary conditional help by opaltoot