On 09/29/2017 09:27 PM, ToddAndMargo wrote:
> $ perl6 -e 'my $x="abc"; $x [R~]= "yyz"; say $x;'
> Potential difficulties:
>     Useless use of [R~]= in sink context
>     at -e:1
>     ------> my $x="abc"; $x ⏏[R~]= "yyz"; say $x;
> yyzabc

This is the correct one. The warning about "useless use" here is a bug
in rakudo. It's meant to warn for things like

    perl6 -e '1 + 2';

where you calculate something and do nothing with it. Here it just
forgets to take into account that this is an assignment operation.

Reply via email to