title: What is print <<EOF; and how is it working?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3414515/help-me-understand-this-perl-statement-with-esq">Help me understand this Perl statement with &lt;&lt;&#39;ESQ&#39;</a>  </p>
  </blockquote>
  
  
  
  <p>What is the statement in <a href="https://stackoverflow.com/questions/4151279/perl-print-eof">https://stackoverflow.com/questions/4151279/perl-print-eof</a> doing exactly? I came across the previous post but didn't understand what he is trying to explain. What is that <code>PETE</code>? Can anyone explain every line? How is the code is working?</p>
  
  <pre><code>print &lt;&lt;EOF;
  This is
  a multiline
  string
  EOF
  
  print &lt;&lt;PETE;
  This is
  a multiline
  string
  PETE
  </code></pre>
  
  <p>What is the difference and similarity between these two? In place of <code>PETE</code> I have used many other words like <code>DOG</code> and it works the same every time.</p>