Whenever you feel there's no intuitive way to do it, write a subroutine.
In this case, let's define, say,
Then you can do exactly_one($x, $y, $z) which is now cleaner than any other solution.sub exactly_one { 1 == grep $_, @_; }
In reply to Re: One out of three ain't bad
by ambrus
in thread One out of three ain't bad
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |