You weren't nesting your ternaries. You seemed to think you were but you weren't. You were putting the next ternary's conditional into the result field of the previous ternary. You should have put the entire next ternary - conditional, result a, and result b - into the result field of the enclosing ternary.
$result = ($major_length == 4800) ? 18 : ($major_length == 8552 and $val == 4) ? 33 : die "not handled";
or...
$result = ($major_length == 4800) ? 18 : ($major_length == 8552) ? ($val == 4 ? 33 : $val == 1 ? 18 : die +"not handled" ) : die "not handled";
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re: nested tabular ternary
by diotalevi
in thread nested tabular ternary
by bowei_99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |