title: Why does my Perl CGI complain "Can't locate Mysql.pm"?
body: <p>I have two folders <code>php</code> and <code>perl</code>. They contain <code>index.php</code> and <code>index.pl</code>, respectively.</p>
  
  <p>My Perl code looks like:</p>
  
  <pre><code>#!/usr/bin/perl
  use Mysql;
  
  print "Content-type: text/html\n\n"; 
  print "&lt;h2&gt;PERL-mySQL Connect&lt;/h2&gt;";
  print "page info";
  $host = "localhost";
  $database = "cdcol";
  $user = "root";
  $password = "";
  $db = Mysql-&gt;connect($host, $database, $user, $password);
  $db-&gt;selectdb($database);
  </code></pre>
  
  <p>When i run above code (by typing <code>http://localhost:88/perl/</code> in the browser), I get the following error:</p>
  
  <p><code>Can't locate Mysql.pm in @INC (@INC contains: C:/xampp/perl/site/lib/ C:/xampp/perl/lib C:/xampp/perl/site/lib C:/xampp/apache) at C:/xampp/htdocs/perl/index.pl line 2. BEGIN failed--compilation aborted at C:/xampp/htdocs/perl/index.pl line 2.</code></p>
  
  <p>whereas browsing to <code>http://localhost:88/php/</code> works.</p>
  
  <p><code>index.php</code> has:</p>
  
  <pre><code>&lt;?php
  $con = mysql_connect("localhost","root","");
      if($con)
      {
          if(mysql_select_db("cdcol", $con))
          {
              $sql="SELECT Id From products";
              if(mysql_query($sql))
              {
                  $result = mysql_query($sql);
                  if ($result) ...
  </code></pre>