Is there a different way to concatenate variables in Perl?
I accidentally wrote the following line of code:
print \"$linenumber is: \\n\" . $linenumb
Variable interpolation occurs when you use double quotes. So, special characters need to be escaped. In this case, you need to escape the $:
print "\$linenumber is: \n" . $linenumber;
It can be rewritten as:
print "\$linenumber is: \n$linenumber";
To avoid string interpolation, use single quotes:
print '$linenumber is: ' . "\n$linenumber"; # No need to escape `$`