“Cannot assign to immutable value” when trying to assign to a string + role
问题 Starting with the example in the Iterable doc page role DNA does Iterable { method iterator(){ self.comb.iterator } }; my @a does DNA = 'GAATCC'; .say for @a; # OUTPUT: «GAATCC» I found it weird it's declared using the @ , so I changed it to the natural way of declaring strings, $ : my $a does DNA = 'GAATCC'; But that fails with a somewhat bewildering "Cannot assign to an immutable value". No need to assign on the spot, so we can do: my $a = 'GAATCC'; $a does DNA; .say for $a; Which