title: cgi script is not executing
body: <p>I have a <code>perl.cgi</code> file which has the content:</p>
  
  <pre><code>#!/usr/bin/perl 
  print "Content-type: text/html\n\n";
  print "&lt;h1&gt;Hello World&lt;/h1&gt;\n";
  </code></pre>
  
  <p>I made it executable. (<code>chmod a+x perl.cgi</code>)</p>
  
  <p>Then I created a new file <code>perl.htm</code> in the same directory. Which has the following data:</p>
  
  <pre><code>Content-type: text/html
  &lt;p&gt;&lt;a href="perl.cgi"&gt;RUN perl.cgi&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>When I run the <code>perl.htm</code> in my browser then I get the output as:</p>
  
  <pre><code>Content-type: text/html
  RUN perl.cgi
  </code></pre>
  
  <p>When I click on <code>RUN perl.cgi</code> another page opens and there the output is:</p>
  
  <pre><code>#!/usr/bin/perl 
  print "Content-type: text/html\n\n";
  print "&lt;h1&gt;Hello World&lt;/h1&gt;\n";
  </code></pre>
  
  <p>i.e. the <code>perl.cgi</code> is not executing. Only the file contents are being shown. </p>
  
  <p><strong>EDIT:</strong> From the answers and comments I came to know that I will have to configure my web server (apache) to run cgi scripts. How can I do that? Let me know. </p>