Documentation for infix :=

Documentation for infix :=, assembled from the following types:

language documentation Operators

From Operators

(Operators) infix :=

Binding operator. Whereas $x = $y puts the value in $y into $x, $x := $y makes $x and $y the same thing.

my $a = 42;
my $b = $a;
$b++;
say $a;

This will output 42, because $a and $b both contained the number 42, but the containers were different.

my $a = 42;
my $b := $a;
$b++;
say $a;

This will output 43, since $b and $a both represented the same object.

Please note that := is a compile time construct. As such it can not be referred to at runtime and thus can't be used as an argument to meta operators.