You can do all standard operations with Boolean values: Boolean AND, OR, and exclusive OR (or XOR):
say False && True; # AND say False || True; # OR say False ^^ True; # XOR
This program prints the following results:
False True True
To negate a Boolean value, use the prefix operator
say !False; # True
Boolean values can be stored in scalar variables:
my $did = True; my $didn't = !$did;
Complete the quiz that covers the contents of this topic.
💪 Or jump directly to the exercises to this section.