in reply to One out of three ain't bad
sub single_true { my $count = 0; $_ && $count++ foreach @_; return $count == 1; } if (single_true($x, $y, $z)) { ... } [download]