which to me looks like:
$OPER = 's' = 'c';
when $test ne 'c' is true. And that should fail with a "Can't modify constant item in scalar assignment" error. However no errors and no warnings are generated for either condition.
Using ?: to select a variable to be assigned to I'm happy with:
test ? $p1 : $p2 = value;
but the half assignement variant implied by the precedence (and made explicit by the brackets shown in your reply) is just bizare.
In reply to Re^3: ternary operator
by GrandFather
in thread ternary operator
by pglenski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |