+, -, and . are operators with the same precedence and they have left-associativity. Thus, your line is parsed:
print( ((("$n1 plus $n2 is " . $n1) + $n2) . "\n") );
Read
perlop for more info.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?