πŸ“˜ Ternary operator ?? !! in Perl 6

πŸ“˜ Ternary operator ?? !! in Raku

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


?? !! is the ternary operator. It works as its counterpart ? : in Perl 5. The characters are doubled to avoid the mixture with infix operators ? and !, which change the context of their operands.

say rand < 0.5 ?? 'Yes' !! 'No';

Leave a Reply

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

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code