in reply to Trinary or If'n'Else?
Obfuscation is in the eye of the observer (obfuscatee?), however. For someone who many years ago programmed in apl, so what? I believe that used appropriately, the trinary operation can be much clearer. For example, consider the following:
compared to:$some_variable = (defined $parm1) ? $parm1 : $default;
and imagined it is duplicated 10 or 20 times. If you understand the perl syntax, there is no obfuscation.if (defined $parm1) { $some_variable = $parm1; } else { $some_variable = $default; }
|
|---|