my $count = 0; $_ and $count++ for ($x,$y,$z); if (1 == $count) { print "Exactly one variable set\n"; }