educative.io

Suggestion to change the sample code

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.

Hi @Suresh1, this is @Usman_Younas from the Educative team. Thank you for your valuable suggestions. We admire and appreciate your efforts to make Educative an excellent place for developers.
Your suggestions are worthwhile, and we will consider them in the next course revamp attempt.
Once again, thank you!