Course: Learn Perl from Scratch
Topic : Precedence and Associativity
Section : Associativity → Right Associativity (Run Sample Code)
$a = 6;
print "6 += 4 => ". ($a += 4); # compined addition operators have right associativity.
Above statements can be changed as below to avoid confusion for the learners.
$a = 6;
print "$a = ".$a;
print “\n”;
print "$a += 4 => ". ($a += 4); # combined addition operators have right associativity.