<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="activestate-perl">
      </a>
      2.10.2 Installing ActiveState Perl on Windows
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045326482176">
  </a>
  <a class="indexterm" name="idm46045326480720">
  </a>
  <a class="indexterm" name="idm46045326479232">
  </a>
  <p>
   On Windows, you should do the following to install the MySQL
   <code class="literal">
    DBD
   </code>
   module with ActiveState Perl:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Get ActiveState Perl from
      <a class="ulink" href="http://www.activestate.com/Products/ActivePerl/" target="_blank">
       http://www.activestate.com/Products/ActivePerl/
      </a>
      and install it.
     </p>
    </li>
    <li class="listitem">
     <p>
      Open a console window.
     </p>
    </li>
    <li class="listitem">
     <p>
      If necessary, set the
      <code class="literal">
       HTTP_proxy
      </code>
      variable.
          For example, you might try a setting like this:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa66860824"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">C:\&gt;</span><span class="token command"> set</span> HTTP_proxy<span class="token attr-value"><span class="token punctuation">=</span>my.proxy.com:3128</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Start the PPM program:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa29582354"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">C:\&gt;</span><span class="token command"> C:\perl\bin\ppm.pl</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      If you have not previously done so, install
      <code class="literal">
       DBI
      </code>
      :
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa12565658"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">ppm&gt; install DBI</code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      If this succeeds, run the following command:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa42099894"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">ppm&gt; install DBD-mysql</code></pre>
     </div>
    </li>
   </ol>
  </div>
  <p>
   This procedure should work with ActiveState Perl 5.6 or higher.
  </p>
  <p>
   If you cannot get the procedure to work, you should install the
      ODBC driver instead and connect to the MySQL server through ODBC:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-perl"><div class="docs-select-all right" id="sa21656460"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-perl"><span class="token keyword">use</span> DBI<span class="token punctuation">;</span>
<span class="token variable">$dbh</span><span class="token operator">=</span> DBI<span class="token operator">-&gt;</span>connect<span class="token punctuation">(</span><span class="token string">"DBI:ODBC:$dsn"</span><span class="token punctuation">,</span><span class="token variable">$user</span><span class="token punctuation">,</span><span class="token variable">$password</span><span class="token punctuation">)</span> <span class="token operator">||</span>
  <span class="token keyword">die</span> <span class="token string">"Got error $DBI::errstr when connecting to $dsn\n"</span><span class="token punctuation">;</span></code></pre>
  </div>
 </div>
 <br/>
</div>
