πŸ“˜ Infix operators in Perl 6

πŸ“˜ Infix operators in Raku

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


Infix operators are placed in a programme between two operands. The majority of the infix operators are binary, and there is a single ternary operator, which expects three operands.

The simplest example of the binary operator is an addition operator +. On the right and left sides it expects two values, for example, two variables: $a + $b. It is important to understand that the same symbol or the same sequence of characters may be either an infix or a prefix operator depending on the context. In the example with a plus, the unary counterpart is a unary plus operator, which coerces the operand to a number: +$str.

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