in reply to Ternary if versus normal if question
If you change:
to:$lights{$light} ? $lights{$light} = 0 : $lights{$light} = 1;
it works ok.$lights{$light} = $lights{$light} ? 0 : 1;
From perlop:
If the argument before the ? is true, the argument before the : is returned, otherwise the argument after the : is returned.
update:
Added quote from the docs
|
|---|