in reply to question of substitution

This statement is the same as:
$foo = $bar; $foo =~ s/this/that/;
But not the same as:
$foo = $bar =~ s/this/that/; #which will return the result of a substitution #because of the lower priority of assignment operator
To make assignment/substitution in the given order you must
define precedence which can be done with parentheses.