I wouldn't call it a need, just preference. I would like "exploiting" such feature this way:
$var1 ?= die "ERROR: \$var1 already set." : $var2;Maybe you'll see more elegant way how to do such thing.
Your suggestion with ||= is not ternary, just "binary", if I understand that correctly.
In reply to Re^2: RFC: "assignary" operator ?= :
by richard.sharpe
in thread RFC: "assignary" operator ?= :
by richard.sharpe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |