📘 Prefix operators ! and not in Perl 6

📘 Prefix operators ! and not in Raku

N. B. Perl 6 has been renamed to Raku. Click to read more.

Prefix operators are those that come in front of their operands. Obviously, prefix operators require only one operand. In some cases, the symbol of the operation can be used as an infix operator when it stands between two operands.

! is the Boolean negation operator.

say !True;     # False
say !(1 == 2); # True

The not operator does the same but has lower precedence.

say not False; # True

Leave a Reply

Your email address will not be published. Required fields are marked *