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

?? !! 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s