πŸ“˜ 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

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