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

Thx, operator precedence is sometimes a PITA

If the precedence was reversed, the intended use would not work.

$y = $c ? $x1 : $x2;
would mean
($y = $c) ? $x1 : $x2;

By the way, it's called the "conditional operator". Perl has many ternary operators.

Replies are listed 'Best First'.
Re^4: Question about ternary operator
by Anonymous Monk on Jul 01, 2009 at 18:38 UTC