📘 Prefix operator ?^ in Perl 6

📘 Prefix operator ?^ in Raku

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

?^ is a logical negation operator. Please note that this is not a bitwise negation. First, the argument is converted to a Boolean value, and then the result is negated.

my $x = 10;
my $y = ?^$x;
say $y;       # False
say $y.WHAT;  # (Bool)

Leave a Reply