title: MySQL error in Perl ( Errorcode 2)
body: <p>I am complete newbie in Perl. I have this little sub</p>
  
  <pre><code>sub processOpen{
      my($filename, $mdbh)=@_;
      my($qr, $query);
  
      # parse filename to get the date extension only
      # we will import the data into the table with this extension
      # /home//logs/open.v7.20120710_2213.log
      my(@fileparts) = split(/\./, $filename);
      my(@filedateparts) = split(/_/, $fileparts[2]);
      my($tableext) = $filedateparts[0];
  
  
      $query = "LOAD DATA INFILE '" . $filename . "' INTO TABLE open_" . $tableext . " FIELDS TERMINATED BY '||' LINES TERMINATED BY '\n'
                (open_datetime, open_date, period,tag_id)";
  
      $qr = $$mdbh-&gt;prepare($query);
      $qr-&gt;execute(); # causes error (see below)
      $qr-&gt;finish();
  }
  </code></pre>
  
  <p>And I'm getting the following error:</p>
  
  <blockquote>
    <p><code>DBD::mysql::st execute failed: Can't get stat of '/home/logs/open..v7.20120710_2213.log' (Errcode: 2) at /home/thisfile.pm line 32.</code></p>
  </blockquote>
  
  <p>Line 32 is the <code>$qr-&gt;execute();</code></p>