El jue., 4 oct. 2018 a las 20:58, ToddAndMargo (<[email protected]>)
escribió:
> Hi All,
>
> I am trying to come up with something like +=
>
> $ p6 'my $v = 32; $v += 2; say $v;'
> 34
>
> to replace
>
> $ p6 'my $v = 0b00100000; $v = $v +| 0b00010000; say $v;'
> 48
>
>
> But I obviously have something wrong:
>
> $ p6 'my $v = 0b00100000; $v +| 0b00010000; say $v;'
> WARNINGS for -e:
> Useless use of "+|" in expression "$v +| 0b00010000"
> in sink context (line 1)
You are not assigning the result of the operation to anything.
say my $v = 0b00100000; $v +|= 0b00010000; say $v; # OUTPUT: «3248»
Cheers
JJ