in reply to nested tabular ternary
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";
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: nested tabular ternary
by McDarren (Abbot) on Apr 11, 2006 at 01:42 UTC | |
by diotalevi (Canon) on Apr 11, 2006 at 02:09 UTC | |
by McDarren (Abbot) on Apr 11, 2006 at 02:35 UTC | |
by diotalevi (Canon) on Apr 11, 2006 at 03:52 UTC | |
by ikegami (Patriarch) on Apr 11, 2006 at 02:22 UTC | |
by McDarren (Abbot) on Apr 11, 2006 at 03:03 UTC | |
by ikegami (Patriarch) on Apr 11, 2006 at 03:53 UTC |