title: How to concatenate variables in Perl
body: <p>Is there a different way to concatenate variables in Perl?</p>
  
  <p>I accidentally wrote the following line of code:</p>
  
  <pre><code>print "$linenumber is: \n" . $linenumber;
  </code></pre>
  
  <p>And that resulted in output like:</p>
  
  <pre><code>22 is:
  22
  </code></pre>
  
  <p>I was expecting:</p>
  
  <pre><code>$linenumber is:
  22
  </code></pre>
  
  <p>So then I wondered. It must be interpreting the <code>$linenumber</code> in the double quotes as a reference to the variable (how cool!).</p>
  
  <p>What are the caveats to using this method and how does this work?</p>