home *** CD-ROM | disk | FTP | other *** search
/ Chip: Windows 2000 Professional Resource Kit / W2KPRK.iso / apps / perl / ActivePerl.exe / data.z / perlwin32faq11.html < prev    next >
Encoding:
Extensible Markup Language  |  1999-10-15  |  18.3 KB  |  583 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3.     "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
  4. <html xmlns="http://www.w3.org/TR/xhtml1">
  5.   <head>
  6.     <title>perlwin32faq11 - Using PPM to install modules</title>
  7.     <link rev="made" href="mailto:hmn@datagraf.dk" />
  8.     <meta name="GENERATOR" charset="iso-8859-1" />
  9.     <link rel="STYLESHEET" href="../win32prk.css" type="text/css"
  10.     media="screen" />
  11.   </head>
  12.  
  13.   <body bgcolor="#ffffff">
  14.     <!-- beginning of leaf header-->
  15.  
  16.     <table width="100%">
  17.       <tr>
  18.         <td bgcolor="000000" width="70" height="31"><a href= 
  19.         "http://www.activestate.com/"><img src="ASbutton.gif" alt= 
  20.         "ActiveState Home Page" border="0" width="68" height=
  21.         "30" /></a></td>
  22.  
  23.         <td width="10" bgcolor="#ffffff"> </td>
  24.  
  25.         <td valign="middle" bgcolor="#cc0066"><font face=
  26.         "sans-serif" size="+1" color="#ff99cc">   
  27.         Win32 FAQ</font></td>
  28.       </tr>
  29.     </table>
  30.     <!-- end of leaf content--><!-- INDEX BEGIN -->
  31.  
  32.     <ul>
  33.       <li><a href="#NAME">NAME</a></li>
  34.  
  35.       <li>
  36.         <a href="#DESCRIPTION">DESCRIPTION</a> 
  37.  
  38.         <ul>
  39.           <li><a href="#what_is_ppm">What is the Perl Package
  40.           Manager (PPM)?</a></li>
  41.  
  42.           <li><a href="#how_do_i_install_ppm">How do I install
  43.           PPM?</a></li>
  44.  
  45.           <li><a href="#running_ppm">How do I run PPM?</a></li>
  46.  
  47.           <li><a href="#using_ppm">How do I use PPM?</a></li>
  48.  
  49.           <li><a href="#repositories">Where are the package
  50.           repositories?</a></li>
  51.  
  52.           <li><a href="#how_to_make_ppm_distribution">How do I make
  53.           a PPM package?</a></li>
  54.  
  55.           <li><a href="#ppm_and_proxies">PPM, Proxies and
  56.           Firewalls</a></li>
  57.         </ul>
  58.       </li>
  59.  
  60.       <li><a href="#AUTHOR_AND_COPYRIGHT">AUTHOR AND
  61.       COPYRIGHT</a></li>
  62.     </ul>
  63.     <!-- INDEX END --><br />
  64.     <hr />
  65.     <br />
  66.     <br />
  67.      
  68.  
  69.     <h1><a name="NAME">NAME</a></h1>
  70.  
  71.     <p>perlwin32faq11 - Using PPM to install modules</p>
  72.     <br />
  73.     <hr />
  74.     <br />
  75.     <br />
  76.      
  77.  
  78.     <h1><a name="DESCRIPTION">DESCRIPTION</a></h1>
  79.  
  80.     <p>How to install and upgrade modules for Perl for Win32 using
  81.     PPM</p>
  82.     <a name="what_is_ppm"></a>
  83.     <hr />
  84.  
  85.     <h1>What is the Perl Package Manager (PPM)?</h1>
  86.  
  87.     <p>The Perl Package Manager (PPM) provides a command line
  88.     interface for managing your Win32-compatible Perl modules and
  89.     extensions (packages). PPM allows you to access package
  90.     repositories, install and remove packages from your system, and
  91.     update packages you previously installed using PPM with the
  92.     latest versions.</p>
  93.     <a name="how_do_i_install_ppm"></a>
  94.     <hr />
  95.  
  96.     <h1>How do I install PPM?</h1>
  97.  
  98.     <p>PPM is installed when you install Perl for Win32. You can
  99.     install Perl for Win32 from within the ActivePerl
  100.     installer.</p>
  101.     <a name="running_ppm"></a>
  102.     <hr />
  103.  
  104.     <h1>How do I run PPM?</h1>
  105.  
  106.     <p>Before you run PPM, you should be connected to the Internet.
  107.     If your Internet connection is via a firewall or proxy, you
  108.     should set the environment variable 'HTTP_proxy' to the name of
  109.     this proxy server. If your proxy server requires a username and
  110.     password, the environment variables 'HTTP_proxy_user' and
  111.     'HTTP_proxy_pass' should be set to these values. See <a href= 
  112.     "#ppm_and_proxies">PPM, Proxies and Firewalls</a> for more
  113.     information.</p>
  114.  
  115.     <p>PPM can then be run by typing 'ppm' in a command prompt
  116.     window.</p>
  117.     <a name="using_ppm"></a>
  118.     <hr />
  119.  
  120.     <h1>How do I use PPM?</h1>
  121.  
  122.     <p>Quick start: at the PPM command prompt, type
  123.     '<code>search</code>' to get a listing of all available
  124.     packages, then type '<code>install <packagename></code>',
  125.     where <code><packagename></code> is the name of a package
  126.     displayed by the '<code>search</code>' command. To list the
  127.     packages you have previously installed using PPM, use the
  128.     '<code>query</code>' command.</p>
  129.  
  130.     <p>If you find the listing of packages scrolls by too quickly,
  131.     you may want to use the command '<code>set more
  132.     <number></code>' to pause the listing after
  133.     <number> packages have been displayed. Use the '<code>set
  134.     save</code>' command to save this configuration for future PPM
  135.     sessions.</p>
  136.  
  137.     <p>By default, PPM will use the ActiveState package repository,
  138.     but this too can be configured using the '<code>set</code>'
  139.     command. See below in <a href="#repositories">Where are the
  140.     package repositories?</a>.</p>
  141.  
  142.     <p>Below is a listing of key PPM commands (you can type
  143.     '<code>help <command></code>' at the PPM prompt for usage
  144.     details for a particular <command>). Items in [brackets]
  145.     are optional.</p>
  146.  
  147.     <table cellpadding="5">
  148.       <tr>
  149.         <td bgcolor="#454545"><font color="#FFFFFF"><b>
  150.         Command</b></font></td>
  151.  
  152.         <td bgcolor="#454545"><font color="#FFFFFF"><b>
  153.         Function</b></font></td>
  154.       </tr>
  155.  
  156.       <tr>
  157.         <td bgcolor="#D4F4A0"><b>genconfig</b></td>
  158.  
  159.         <td bgcolor="#E5E4F0">prints a minimal PPM configuration
  160.         file to STDOUT</td>
  161.       </tr>
  162.  
  163.       <tr>
  164.         <td bgcolor="#D4F4A0"><b>help [command]</b></td>
  165.  
  166.         <td bgcolor="#E5E4F0">lists available commands, or help on
  167.         'command'.</td>
  168.       </tr>
  169.  
  170.       <tr>
  171.         <td bgcolor="#D4F4A0"><b>info [package1...]</b></td>
  172.  
  173.         <td bgcolor="#E5E4F0">prints a summary of installed
  174.         packages.</td>
  175.       </tr>
  176.  
  177.       <tr>
  178.         <td bgcolor="#D4F4A0"><b>install package1
  179.         [package2...]</b></td>
  180.  
  181.         <td bgcolor="#E5E4F0">installs specified packages.</td>
  182.       </tr>
  183.  
  184.       <tr>
  185.         <td bgcolor="#D4F4A0"><b>quit</b></td>
  186.  
  187.         <td bgcolor="#E5E4F0">exits the program.</td>
  188.       </tr>
  189.  
  190.       <tr>
  191.         <td bgcolor="#D4F4A0"><b>query [pattern]</b></td>
  192.  
  193.         <td bgcolor="#E5E4F0">lists installed packages, or packages
  194.         containing <code>pattern</code>.</td>
  195.       </tr>
  196.  
  197.       <tr>
  198.         <td bgcolor="#D4F4A0"><b>query /abstract [pattern]</b></td>
  199.  
  200.         <td bgcolor="#E5E4F0">lists descriptions of installed
  201.         packages, or package descriptions containing <code>
  202.         pattern</code>.</td>
  203.       </tr>
  204.  
  205.       <tr>
  206.         <td bgcolor="#D4F4A0"><b>remove package1
  207.         [package2...]</b></td>
  208.  
  209.         <td bgcolor="#E5E4F0">removes the specified packages from
  210.         the system.</td>
  211.       </tr>
  212.  
  213.       <tr>
  214.         <td bgcolor="#D4F4A0"><b>search [pattern]</b></td>
  215.  
  216.         <td bgcolor="#E5E4F0">lists available packages, or packages
  217.         containing <code>pattern</code>.</td>
  218.       </tr>
  219.  
  220.       <tr>
  221.         <td bgcolor="#D4F4A0"><b>search /abstract
  222.         [pattern]</b></td>
  223.  
  224.         <td bgcolor="#E5E4F0">lists descriptions of available
  225.         packages, or package descriptions containing <code>
  226.         pattern</code>.</td>
  227.       </tr>
  228.  
  229.       <tr>
  230.         <td bgcolor="#D4F4A0"><b>set</b></td>
  231.  
  232.         <td bgcolor="#E5E4F0">set/display current options.</td>
  233.       </tr>
  234.  
  235.       <tr>
  236.         <td bgcolor="#D4F4A0"><b>set save</b></td>
  237.  
  238.         <td bgcolor="#E5E4F0">save current options.</td>
  239.       </tr>
  240.  
  241.       <tr>
  242.         <td bgcolor="#D4F4A0"><b>summary [package1...]</b></td>
  243.  
  244.         <td bgcolor="#E5E4F0">prints a summary of available
  245.         packages.</td>
  246.       </tr>
  247.  
  248.       <tr>
  249.         <td bgcolor="#D4F4A0"><b>verify [package1...]</b></td>
  250.  
  251.         <td bgcolor="#E5E4F0">verifies currently installed packages
  252.         are up to date.</td>
  253.       </tr>
  254.  
  255.       <tr>
  256.         <td bgcolor="#D4F4A0"><b>verify /upgrade
  257.         [package1...]</b></td>
  258.  
  259.         <td bgcolor="#E5E4F0">installs available package
  260.         upgrades.</td>
  261.       </tr>
  262.     </table>
  263.  
  264.     <p>A pattern is a search string just like the regular
  265.     expressions - for example if you search for with this
  266.     command</p>
  267.  
  268.     <blockquote>
  269.       <p>search ODBC|DBI</p>
  270.     </blockquote>
  271.  
  272.     <p>(which means <i>'search for packages in which the characters
  273.     ODBC and/or the characters DBI are present in that order'</i>)
  274.     you get a result like this</p>
  275.  
  276.     <blockquote>
  277.       <p>Apache-DBI<br />
  278.       DBD-ODBC<br />
  279.       DBI<br />
  280.       FindBin<br />
  281.       Win32-ODBC</p>
  282.     </blockquote>
  283.  
  284.     <p>Note that if you use 'search /abstract [pattern]' the search
  285.     will not only be in the package names, but also in the abstract
  286.     section of the package files</p>
  287.     <a name="repositories"></a>
  288.     <hr />
  289.  
  290.     <h1>Where are the package repositories?</h1>
  291.  
  292.     <p>By default, PPM will use the ActiveState package repository,
  293.     but there are other repositories on the Internet. At the moment
  294.     there are these repositories:</p>
  295.  
  296.     <blockquote>
  297.       <table border="0" cellspacing="10">
  298.         <tr>
  299.           <td valign="top" align="left" width="50%"><a href= 
  300.           "http://www.activestate.com/packages/">
  301.           http://www.activestate.com/packages</a></td>
  302.  
  303.           <td valign="top" align="left" width="50%">The default
  304.           package repository from ActiveState</td>
  305.         </tr>
  306.  
  307.         <tr>
  308.           <td valign="top" align="left" width="50%"><a href= 
  309.           "http://Jenda.Krynicky.cz/perl/">
  310.           http://Jenda.Krynicky.cz/perl</a></td>
  311.  
  312.           <td valign="top" align="left" width="50%">Jan Krynicky's
  313.           package repository</td>
  314.         </tr>
  315.  
  316.         <tr>
  317.           <td valign="top" align="left" width="50%"><a href= 
  318.           "http://www.roth.net/perl/packages/">
  319.           http://www.roth.net/perl/packages/</a></td>
  320.  
  321.           <td valign="top" align="left" width="50%">Roth
  322.           Consulting's package repository</td>
  323.         </tr>
  324.  
  325.         <tr>
  326.           <td valign="top" align="left" width="50%"><a href= 
  327.           "http://www.xray.mpe.mpg.de/~ach/ptk/ppm">
  328.           http://www.xray.mpe.mpg.de/~ach/ptk/ppm</a></td>
  329.  
  330.           <td valign="top" align="left" width="50%">Achim Bohnet's
  331.           package repository</td>
  332.         </tr>
  333.  
  334.         <tr>
  335.           <td valign="top" align="left" width="50%"><a href= 
  336.           "http://rto.dk/packages/">
  337.           http://rto.dk/packages/</a></td>
  338.  
  339.           <td valign="top" align="left" width="50%">RTO's packages
  340.           repository (mostly mirrors of the above)</td>
  341.         </tr>
  342.  
  343.         <tr>
  344.           <td colspan="2">
  345.             <hr width="50%" />
  346.           </td>
  347.         </tr>
  348.  
  349.         <tr>
  350.           <td valign="top" align="left" width="50%"><a href= 
  351.           "http://www.fastnetltd.ndirect.co.uk/Perl/zips/">
  352.           http://www.fastnetltd.ndirect.co.uk/Perl/zips/</a></td>
  353.  
  354.           <td valign="top" align="left" width="50%">Fastnet
  355.           Software Ltd's packages - not directly accessible from
  356.           PPM at present</td>
  357.         </tr>
  358.       </table>
  359.     </blockquote>
  360.  
  361.     <p>To use these package repositories you start PPM and at the
  362.     prompt type</p>
  363.  
  364.     <blockquote>
  365.       <p>set repository <i>NAME</i> <i>URL</i></p>
  366.     </blockquote>
  367.  
  368.     <p>where <i>NAME</i> is a name by which you want to reference
  369.     the repository from PPM and <i>URL</i> is the URL to the
  370.     repository. You could for example type</p>
  371.  
  372.     <blockquote>
  373.       <p>set repository JENDA http://Jenda.Krynicky.cz/perl</p>
  374.     </blockquote>
  375.  
  376.     <p>The next time you do a 'search' you will not only search the
  377.     ActiveState package repository but also the repositories you
  378.     have added. Before you exit PPM you should save the changes to
  379.     the configuration by issuing the command 'set save'.</p>
  380.     <a name="how_to_make_ppm_distribution"></a>
  381.     <hr />
  382.  
  383.     <h1>How do I make a PPM package?</h1>
  384.  
  385.     <p>If you want to make a PPM package for use on other machine
  386.     you can do it like this:</p>
  387.  
  388.     <p>Specify the AUTHOR and ABSTRACT parameters in the
  389.     Makefile.PL. However you should only pass them to WriteMakefile
  390.     if the version of the perl is greater than 5.005 - older perls
  391.     do not have these parameters added and do not expect to see
  392.     them. This is an example Makefile.PL:</p>
  393.  
  394.     <blockquote>
  395.       <p><code>use ExtUtils::MakeMaker;<br />
  396.       # See lib/ExtUtils/MakeMaker.pm for details of how to
  397.       influence<br />
  398.       # the contents of the Makefile that is written.<br />
  399.       WriteMakefile(<br />
  400.           'NAME' => 'Term::Control',<br />
  401.           'VERSION_FROM' => 'Control.pm', #
  402.       finds $VERSION<br />
  403.           ($] ge '5.005') ? (<br />
  404.               'AUTHOR'
  405.       => 'Johnny Doel (johnny@doel.org)',<br />
  406.               'ABSTRACT'
  407.       => 'Control the IO for terminals',<br />
  408.           ) : (),<br />
  409.       );</code></p>
  410.     </blockquote>
  411.  
  412.     <p>Then you make the archive with the commands</p>
  413.  
  414.     <blockquote>
  415.       <p><code>perl Makefile.PL<br />
  416.       nmake</code></p>
  417.     </blockquote>
  418.  
  419.     <p>The resulting files are placed in the blib directory that is
  420.     created when you run nmake. These files should be packed into
  421.     an archive like this:</p>
  422.  
  423.     <blockquote>
  424.       <p><code>tar cvf <i>package</i>.tar blib<br />
  425.       gzip --best <i>package</i>.tar</code></p>
  426.     </blockquote>
  427.  
  428.     <p>You now have an archive called <i>package</i>.tar.gz. Then
  429.     you generate the PPD file by:</p>
  430.  
  431.     <blockquote>
  432.       <p><code>nmake ppd</code></p>
  433.     </blockquote>
  434.  
  435.     <p>You have to edit the resulting PPD file and add the location
  436.     of the package archive into <CODEBASE HREF="" />. The
  437.     location is relative to the PPD file.</p>
  438.  
  439.     <p>You can get nmake from <a href= 
  440.     "ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe">
  441.     ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe</a>. You
  442.     can get tar and gzip from <a href= 
  443.     "http://www.itribe.net/virtunix/">
  444.     http://www.itribe.net/virtunix/</a>.</p>
  445.     <a name="ppm_and_proxies"></a>
  446.     <hr />
  447.  
  448.     <h1>PPM, Proxies and Firewalls</h1>
  449.  
  450.     <p>If you use a proxy server or firewall, you might have
  451.     trouble running PPM. Here is the solution.</p>
  452.  
  453.     <blockquote>
  454.       <p><b><i>NOTE</i></b>: If none of the changes in this
  455.       document work for you, you may download individual packages
  456.       from <a href="http://www.activestate.com/packages/zips">
  457.       here</a> and install them according to the directions in the
  458.       README file contained within the ZIP file. If you want, you
  459.       can also keep a local repository, with several .ppd files in
  460.       a permanent repository directory, and their .tar.gz files in
  461.       an <i>x86</i> directory beneath that.</p>
  462.     </blockquote>
  463.  
  464.     <ol start="1">
  465.       <li>
  466.         <p><b>Set Environment Vars</b></p>
  467.       </li>
  468.     </ol>
  469.  
  470.     <blockquote>
  471.       <p>Up to three environment variables need to be set.</p>
  472.     </blockquote>
  473.  
  474.     <blockquote>
  475.       <p><strong>Under Windows NT<br />
  476.       </strong> Right click on "My Computer", click on
  477.       "properties", select the "environment" tab. These are your
  478.       environment settings. Make the following changes:<br />
  479.       <br />
  480.       </p>
  481.  
  482.       <ol>
  483.         <li>Add the setting HTTP_proxy, with your proxy name as the
  484.         value (<em><strong>you must include "http://"</strong></em>
  485.         ), followed by a colon and the proxy port, if applicable;
  486.         e.g., "http://proxy:8080"</li>
  487.  
  488.         <li>If you require a user name and/or password to access
  489.         your proxy, add the settings HTTP_proxy_user and
  490.         HTTP_proxy_pass, with your user name and password as the
  491.         respective values</li>
  492.  
  493.         <li><br />
  494.         </li>
  495.       </ol>
  496.     </blockquote>
  497.  
  498.     <blockquote>
  499.       <p><strong>Under Windows 95<br />
  500.       </strong> In your AUTOEXEC.BAT file, place the following
  501.       lines then reboot so the changes can take effect:</p>
  502.     </blockquote>
  503.  
  504.     <blockquote>
  505.       <ol start="1">
  506.         <li>SET HTTP_proxy=<your proxy server (<strong><em>you
  507.         must include "http://"</em></strong> >, followed by a
  508.         colon and the proxy port, if applicable; e.g., SET
  509.         HTTP_proxy=http://proxy:8080</li>
  510.  
  511.         <li>SET HTTP_proxy_user=<your user name> (if
  512.         required)</li>
  513.  
  514.         <li>SET HTTP_proxy_pass=<your password> (if
  515.         required)<br />
  516.         <br />
  517.         </li>
  518.       </ol>
  519.     </blockquote>
  520.  
  521.     <ol start="2">
  522.       <li>
  523.         <p><b>Try using PPM</b></p>
  524.       </li>
  525.     </ol>
  526.  
  527.     <blockquote>
  528.       <p>With your internet connection active, try using PPM again.
  529.       Try to install a small package, like File-Slurp. You'll know
  530.       that it still fails if you see an error stating that it can't
  531.       find a ppd file for the specified package.</p>
  532.     </blockquote>
  533.  
  534.     <ol start="3">
  535.       <li>
  536.         <p><b>Further Information and Help</b></p>
  537.       </li>
  538.     </ol>
  539.  
  540.     <blockquote>
  541.       <p>If there were problems with any of the above hints, please
  542.       see <a href="readme.htm#More_Info">here</a> on how to get
  543.       further help.</p>
  544.     </blockquote>
  545.     <br />
  546.     <hr />
  547.  
  548.     <h1><a name="AUTHOR_AND_COPYRIGHT">AUTHOR AND
  549.     COPYRIGHT</a></h1>
  550.  
  551.     <p>This <font size="-1">FAQ</font> was originally assembled and
  552.     maintained by Evangelo Prodromou. <a href= 
  553.     "mailto:evangelo@endcontsw.com">evangelo@endcontsw.com</a>. It
  554.     has been revised and updated by Brian Jepson of O'Reilly and
  555.     Associates, David Grove, David Dmytryshyn, Murray Nesbitt of
  556.     ActiveState, Henning Michael Møller-Nielsen of RTO and
  557.     Kevin Meltzer.</p>
  558.  
  559.     <p>This <font size="-1">FAQ</font> is in the public domain. If
  560.     you use it, however, please ensure that you give credit to the
  561.     original authors.</p>
  562.  
  563.     <p><!-- beginning of leaf footer--></p>
  564.  
  565.     <table width="100%">
  566.       <tr>
  567.         <td bgcolor="000000" width="70" height="31"><a href= 
  568.         "http://www.activestate.com/"><img src="ASbutton.gif" alt= 
  569.         "ActiveState Home Page" border="0" width="68" height=
  570.         "30" /></a></td>
  571.  
  572.         <td width="10"> </td>
  573.  
  574.         <td valign="middle" bgcolor="#cc0066"><font face=
  575.         "sans-serif" size="+1" color="#ff99cc">   
  576.         Win32 FAQ</font></td>
  577.       </tr>
  578.     </table>
  579.     <!-- end  of leaf footer-->
  580.   </body>
  581. </html>
  582.  
  583.