.=method is a mutating call of the method on an object. The call $x.=method does the same as the more verbose assignment $x = $x.method.
In the following example, the $o container initially holds an object of the C class, but after $o.=m(), the value will be replaced with an instance of the D class.
class D { }ย
class C {
ย ย ย method m() {
ย ย ย ย ย ย ย return D.new;
ย ย ย }
}
my $o = C.new;
say $o.WHAT;ย # (C)ย
$o.=m();
say $o.WHAT;ย # (D)