home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
- <html xmlns="http://www.w3.org/TR/xhtml1">
- <head>
- <title>perlwin32faq1 - Availability and Installation</title>
- <link rev="made" href="mailto:bjepson@debian.ids.net" />
- <meta name="GENERATOR" charset="iso-8859-1" />
- <link rel="STYLESHEET" href="../win32prk.css" type="text/css"
- media="screen" />
- </head>
-
- <body bgcolor="#ffffff">
- <!-- beginning of leaf header-->
-
- <table width="100%">
- <tr>
- <td bgcolor="000000" width="70" height="31"><a href=
- "http://www.activestate.com/"><img src="ASbutton.gif" alt=
- "ActiveState Home Page" border="0" width="68" height=
- "30" /></a></td>
-
- <td width="10" bgcolor="#ffffff"> </td>
-
- <td valign="middle" bgcolor="#cc0066"><font face=
- "sans-serif" size="+1" color="#ff99cc">
- Win32 FAQ</font></td>
- </tr>
- </table>
- <!-- end of leaf content--><!-- INDEX BEGIN -->
-
- <ul>
- <li><a href="#NAME">NAME</a></li>
-
- <li>
- <a href="#DESCRIPTION">DESCRIPTION</a>
-
- <ul>
- <li><a href="#What_is_Perl_">What is Perl?</a></li>
-
- <li><a href="#Where_can_I_get_tons_of_informat">Where can
- I get tons of information about Perl?</a></li>
-
- <li><a href="#Where_is_the_Perl_for_Win32_inte">Where is
- the Perl for Win32 interpreter available?</a></li>
-
- <li><a href="#What_do_I_get_with_ActiveState_s">What do I
- get with ActiveState's Perl for Win32?</a></li>
-
- <li><a href="#How_do_I_install_the_Perl_for_Wi">How do I
- install the Perl for Win32 package?</a></li>
-
- <li><a href="#How_can_I_customize_my_installat">How can I
- customize my installation of Perl for Win32?</a></li>
-
- <li><a href="#How_do_I_uninstall_Perl_for_Win3">How do I
- uninstall Perl for Win32?</a></li>
-
- <li><a href="#What_is_ActiveX_Scripting_">What is ActiveX
- Scripting?</a></li>
-
- <li><a href="#Is_there_an_ActiveX_Scripting_ve">Is there
- an ActiveX Scripting version of Perl available?</a></li>
-
- <li><a href="#What_other_scripting_languages_a">What
- other scripting languages are available for Win32
- platforms?</a></li>
-
- <li><a href="#When_I_double_click_the_perl_exe">When I
- double-click the perl.exe icon in Explorer, I
- get</a></li>
-
- <li><a href="#How_can_I_get_Perl_to_run_a_Perl">How can I
- get Perl to run a Perl script at the 4DOS command line
- by</a></li>
-
- <li><a href="#Can_I_build_perl_from_the_source">Can I
- build perl from the source code?</a></li>
- </ul>
- </li>
-
- <li><a href="#AUTHOR_AND_COPYRIGHT">AUTHOR AND
- COPYRIGHT</a></li>
- </ul>
- <!-- INDEX END -->
- <hr />
- <br />
-
- <h1><a name="NAME">NAME</a></h1>
-
- <p>perlwin32faq1 - Availability and Installation</p>
- <br />
- <hr />
-
- <h1><a name="DESCRIPTION">DESCRIPTION</a></h1>
-
- <p>Getting, installing, and using Perl.</p>
- <br />
- <hr />
-
- <h2><a name="What_is_Perl_">What is Perl?</a></h2>
-
- <p>Perl is a scripting language widely used for system
- administration and programming on the World Wide Web. It
- originated in the <font size="-1">UNIX</font> community and has
- a strong <font size="-1">UNIX</font> slant, but usage on the
- Win32 platforms is growing rapidly. With the coming of the Perl
- Resource Kit for Win32, Perl on Win32 is just as powerful as it
- is on <font size="-1">UNIX</font> systems.</p>
-
- <p>perl (small 'p') is the program used to interpret the Perl
- language.</p>
- <br />
- <hr />
-
- <h2><a name="Where_can_I_get_tons_of_informat">Where can I get
- tons of information about Perl?</a></h2>
-
- <p>Extensive online documentation is included with Perl itself.
- You can read the documentation with the <code>perldoc</code>
- command, as in <code>perldoc document_name</code>. You should
- start with the perl document and the perlfaq document. For
- information on other ways of accessing the Perl documentation
- (including <font size="-1">HTML</font> versions of this
- documentation), see <a href=
- "perlwin32faq3.html#Where_can_I_get_documentation_on">Where can
- I get documentation on Perl for Win32?</a>.</p>
-
- <p>To get more information about Perl, check out these
- URLs:</p>
-
- <ul>
- <li>
- <p><a href="http://www.ActiveState.com">
- http://www.ActiveState.com</a> - The Perl for Win32 Home
- Page.</p>
- </li>
-
- <li>
- <p><a href="http://www.perl.com">http://www.perl.com</a> -
- The Perl home page.</p>
- </li>
-
- <li>
- <p><a href="http://language.perl.com">
- http://language.perl.com</a> - The Perl language home
- page.</p>
- </li>
-
- <li>
- <p><a href=
- "http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/">
- http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/</a>
- - The Yahoo Perl page.</p>
- </li>
- </ul>
-
- <p>There are several good books about Perl. The premier book on
- Perl for Win32 is <em>Learning Perl On Win32 Systems</em> By
- Schwartz, Olson, and Christiansen (O'Reilly & Associates,
- 1997). This is the Gecko book, and has a picture of a gecko
- (little chubby lizard with big toes and a smile) on the front
- cover.</p>
-
- <p>For general perl, two books to consider are <em>Programming
- Perl</em>, 2nd Edition, by Larry Wall, Tom Christiansen and
- Randal <font size="-1">L.</font> Schwartz (O'Reilly &
- Associates, 1996) and <em>Learning Perl</em>, by Randal <font
- size="-1">L.</font> Schwartz (O'Reilly & Associates, 1993).
- These are referred to by Perl enthusiasts as the Camel book and
- the Llama book, respectively.</p>
-
- <p>If you are new to Perl and there are any terms mentioned in
- this <font size="-1">FAQ</font> that you don't get, try one of
- the above resources. See the <em>perlbook</em> document that
- comes with Perl for more information.</p>
- <br />
- <hr />
-
- <h2><a name="Where_is_the_Perl_for_Win32_inte">Where is the
- Perl for Win32 interpreter available?</a></h2>
-
- <p>The Perl for Win32 package is available by anonymous <font
- size="-1">FTP</font> from ActiveState and from <font size="-1">
- CPAN,</font> the Comprehensive Perl Archive Network.</p>
-
- <p>To download from ActiveState, look in this directory:</p>
- <br />
- <pre>
- <a href=
- "http://www.ActiveState.com/pw32/">http://www.ActiveState.com/pw32/</a>
- </pre>
- <br />
- <hr />
-
- <h2><a name="What_do_I_get_with_ActiveState_s">What do I get
- with ActiveState's Perl for Win32?</a></h2>
-
- <p>ActiveState's Perl for Win32 is a complete, self-installing
- distribution of Perl based on the standard Perl sources. It is
- distributed online at the ActiveState site and is bundled with
- the Perl Resource Kit for Win32. See <a href=
- "http://www.ActiveState.com">http://www.ActiveState.com</a> and
- <a href="http://perl.oreilly.com">http://perl.oreilly.com</a>
- for more information.</p>
-
- <p>``Perl for Win32'' generally refers to the ActiveState
- release of Perl.</p>
-
- <p>Perl for Win32 was developed by ActiveState Tool Corporation
- (originally Hip Communications) for Microsoft Corporation. This
- effort was undertaken for inclusion in Microsoft's Windows
- <font size="-1">NT</font> Resource Kit.</p>
-
- <p>Since then, ActiveState and various Perl porters have worked
- to keep Perl for Win32 current with the standard release of
- Perl. The oneperl effort, a joint effort between O'Reilly,
- ActiveState, and various volunteers, has joined the Win32 and
- standard Perl source code into one common source tree.</p>
-
- <p>The Perl Resource Kit for Win32 from O'Reilly includes perl,
- PerlIS, the Perl Debugger, and several Win32-specific modules
- and tools developed by ActiveState.</p>
- <br />
- <hr />
-
- <h2><a name="How_do_I_install_the_Perl_for_Wi">How do I install
- the Perl for Win32 package?</a></h2>
-
- <p>Simply double-click the archive you downloaded, and you will
- be guided through the installation process by the installation
- wizard. You can select the parts of the Perl package you want
- installed, and the location you want to install them to.</p>
- <br />
- <hr />
-
- <h2><a name="How_can_I_customize_my_installat">How can I
- customize my installation of Perl for Win32?</a></h2>
-
- <p><em>NOTE:</em> The following information applies only if you
- have a <em>versioned</em> perl installation. Newer versions of
- ActivePerl use a simple (non-<em>versioned</em>) installation
- structure by default, which is described <a href=
- "dirstructure.html">here</a>. See the perlwin32 documentation
- page for more information on how to get a <em>versioned</em>
- installation.</p>
-
- <p>Perl uses the <code>@INC</code> array as a search path for
- <code>use</code>'d and <code>require</code>'d files. (run
- <code>perl -V</code> to see what's in <code>@INC</code>) This
- can be manipulated at run-time with <code>use lib
- 'directory_to_add'</code> or by modifying the Registry or
- environment. By default, the following directories are added to
- <code>@INC</code>:</p>
- <br />
- <pre>
- <myperldir>/site/<version>/lib/<architecturename>
- <myperldir>/site/<version>/lib
- <myperldir>/<version>/lib/<architecturename>
- <myperldir>/<version>/lib
- </pre>
-
- <p>Where <myperldir> is your Perl home directory, such as
- <em>C:\Perl</em>. And <architecturename> is something
- like MSWin32-x86 or MSWin32-Alpha.</p>
-
- <p>There are a few registry entries you can use to customize
- your setup. Under the following keys:
- [HKEY_LOCAL_MACHINE/Software/Perl/] and
- [HKEY_CURRENT_USER/Software/Perl/], you can add the following
- String values:</p>
- <br />
- <pre>
- LIB
- LIB-<perlversion>
- </pre>
-
- <p>such as:</p>
- <br />
- <pre>
- LIB
- LIB-5.0050
- </pre>
-
- <p>This adds the directory, or directories, you specify to the
- default lib paths (for Perl 5.005, this is <em>
- C:\Perl\5.00500\lib\MSWin32-x86</em> and <em>
- C:\Perl\5.00500\lib</em>). The LIB-<perlversion> allows
- you to customize the path for a given version of Perl, if you
- have multiple versions of Perl installed. <font size="-1">
- SITELIB</font> SITELIB-<perlversion></p>
-
- <p>such as:</p>
- <br />
- <pre>
- SITELIB
- SITELIB-5.0050
- </pre>
-
- <p>This adds the directory, or directories, you specify to the
- default sitelib paths (for Perl 5.005, this is <em>
- C:\Perl\site\5.00500\lib\MSWin32-x86</em>, <em>
- C:\Perl\site\5.00500\lib</em>, and <em>C:\Perl\site\lib</em>).
- The SITELIB-<perlversion> allows you to customize the
- site path for a given version of Perl, if you have multiple
- versions of Perl installed.</p>
-
- <p><code>[HKEY_CURRENT_USER/Software/Perl]</code> is searched
- before <code>[HKEY_LOCAL_MACHINE/Software/Perl]</code>, so you
- can customize Perl on a per-user basis.</p>
-
- <p>In addition, if you set the environment variable <code>
- Perl5lib</code>, it will be added to <code>@INC</code> as well.
- <code>Perl5lib</code> will be looked up in the environment
- first, and then in the registry as outlined above.</p>
- <br />
- <hr />
-
- <h2><a name="How_do_I_uninstall_Perl_for_Win3">How do I
- uninstall Perl for Win32?</a></h2>
-
- <p>Go to Add/Remove Programs in the Control Panel, choose Perl
- for Win32 from the list box, and click Remove.</p>
- <br />
- <hr />
-
- <h2><a name="What_is_ActiveX_Scripting_">What is ActiveX
- Scripting?</a></h2>
-
- <p>ActiveX Scripting is a Microsoft technology that consists of
- script engines and script hosts. <font size="-1">A</font>
- script engine, such as PerlScript, VBScript, or JScript, is a
- programming language that can be embedded in a scripting host,
- such as Windows Scripting Host, Microsoft Exchange, and Active
- Server Pages <font size="-1">(ASP).</font></p>
- <br />
- <hr />
-
- <h2><a name="Is_there_an_ActiveX_Scripting_ve">Is there an
- ActiveX Scripting version of Perl available?</a></h2>
-
- <p>Yes. This is called PerlScript. It is part of the Perl for
- Win32 package, and can be optionally installed during
- installation.</p>
-
- <p>PerlScript can be used within any ActiveX Scripting Host
- such as Microsoft Internet Explorer 4.0, Microsoft Exchange,
- and the Windows Scripting Host.</p>
- <br />
- <hr />
-
- <h2><a name="What_other_scripting_languages_a">What other
- scripting languages are available for Win32 platforms?</a></h2>
-
- <p>Although it's possible to program in batch language or with
- <font size="-1">QBASIC</font> (a 16-bit <font size="-1">
- BASIC</font> interpreter that comes with Windows 95 and Windows
- <font size="-1">NT),</font> serious programmers will probably
- prefer one of the following other options:</p>
-
- <dl>
- <dt><strong><a name="item_Python">Python</a></strong></dt>
-
- <dd>
- <p> <font size="-1">A</font> very full-featured language,
- widely-used. <font size="-1">OOP,</font> networking, <font
- size="-1">CGI,</font> database, <font size="-1">GUI</font>
- programming. See <a href="http://www.python.org/">
- http://www.python.org/</a></p>
- </dd>
-
- <dt><strong><a name="item_Object">Object
- REXX</a></strong></dt>
-
- <dd>
- <p>An update of <font size="-1">REXX</font> for the <font
- size="-1">OOP</font> decade. See <a href=
- "http://www2.hursley.ibm.com/orexx/">
- http://www2.hursley.ibm.com/orexx/</a></p>
- </dd>
-
- <dt><strong><a name="item_Tcl">Tcl/Tk</a></strong></dt>
-
- <dd>
- <p>The Tool Command Language. More information is available
- at <a href="http://www.tclconsortium.org">
- http://www.tclconsortium.org</a></p>
- </dd>
- </dl>
-
- <p>Awk and <font size="-1">UNIX</font> shell languages are
- available in several UNIX-to-NT packages (see <a href=
- "perlwin32faq4.html#Where_can_I_find_Win32_ports_of_">Where can
- I find Win32 ports of UNIX tools?</a>). <font size="-1">
- 4NT</font> and <font size="-1">4DOS</font> scripting are
- popular among the shell scripting languages. <font size="-1">
- (4DOS</font> also solves some of the command shell problems
- under Windows 95/98, and, with a little work, even makes thing
- better under <font size="-1">NT.)</font></p>
- <br />
- <hr />
-
- <h2><a name="When_I_double_click_the_perl_exe">When I
- double-click the perl.exe icon in Explorer, I get an empty DOS
- window with a blinking cursor.</a></h2>
-
- <p>Perl for Win32 is a Win32 command-line program. It expects
- to be run from the command line, not from Explorer.</p>
-
- <p>If you want to run a Perl script, write the script out using
- a text editor like Notepad. <font size="-1">A</font> good
- starter program is:</p>
- <br />
- <pre>
- print "Hello, World!\n";
- </pre>
-
- <p>Save the program to a file (such as <em>
- C:\temp\hello.pl</em>). Now, start a command prompt window
- (sometimes erroneously called a <font size="-1">DOS</font>
- window), and type the following line at the command prompt:</p>
- <br />
- <pre>
- C:\> perl c:\temp\hello.pl
- </pre>
-
- <p>This should print out the words <code>Hello, World!</code>
- on the screen. You may have to do some fiddling with the <code>
- PATH</code> environment variable, or specify the full path name
- to <em>perl.exe</em>, in order for this to work.</p>
-
- <p><em>perl.exe</em> has a lot of nifty command-line arguments
- that can make your work easier. See <em>perlrun</em> for
- details.</p>
-
- <p>To answer the original question about what's happening when
- you start perl from an Explorer window rather than a
- command-line window: starting from Explorer is roughly the same
- as starting perl without any command line arguments. When perl
- is started without a script file specified on the command line,
- it expects to receive a Perl program as standard input, i.e.,
- from the keyboard.</p>
-
- <p>The blinking cursor means perl is waiting for your input.
- You can actually type in a Perl program from the keyboard, and
- then tell perl to execute it by typing the Ctrl-Z, which is the
- end-of-file marker on Windows systems.</p>
- <br />
- <hr />
-
- <h2><a name="How_can_I_get_Perl_to_run_a_Perl">How can I get
- Perl to run a Perl script at the 4DOS command line by typing
- the name of the script without the extension or "perl", just
- like a regular exe file?</a></h2>
-
- <p>See also <a href=
- "perlwin32faq4.html#How_do_I_associate_Perl_scripts_">How do I
- associate Perl scripts with perl?</a>.</p>
-
- <p>You can add a line like</p>
- <br />
- <pre>
- SET .PL=C:\PERL\BIN\PERL.EXE
- </pre>
-
- <p>to your <em>AUTOEXEC.BAT</em> file under Win95/98. You can
- then type <scriptname> with no extension to run your
- script, even if you are not in the same directory as the script
- and the script path is on your path.</p>
-
- <p>Note, however, that this only works with <font size="-1">
- 4DOS,</font> not <em>COMMAND.COM</em>, <em>CMD32.EXE</em>, or
- <em>CMD.EXE</em>. With those shells you still need to type</p>
- <br />
- <pre>
- perl scriptname.pl <arg> <arg> <arg>
- </pre>
- <br />
- <hr />
-
- <h2><a name="Can_I_build_perl_from_the_source">Can I build perl
- from the source code?</a></h2>
-
- <p>The Perl source code includes complete instructions on
- building Perl. You can obtain the latest Perl source from:</p>
- <br />
- <pre>
- <a href=
- "http://www.perl.com/CPAN/src/latest.tar.gz">http://www.perl.com/CPAN/src/latest.tar.gz</a>
- </pre>
-
- <p>Once you extract the source, read the <em>README</em> and
- <em>README.win32</em> files for instructions on compiling
- Perl.</p>
-
- <p>On Windows, you have a choice of building a version of Perl
- using a Win32 compiler or building it with a development
- environment that offers emulation of many <font size="-1">
- UNIX</font> features, such as <code>fork().</code> Using a
- native Win32 compiler will also allow you to more easily hook
- into Win32 APIs, such as <font size="-1">ODBC,</font> <font
- size="-1">ASP,</font> <font size="-1">ISAPI,</font> and others.
- Also, the native Win32 builds of Perl for Win32 are more widely
- used and are thus better tested.</p>
-
- <p>If you need a development tool that integrates wonderfully
- with the rest of the Win32 environment, go with a native Win32
- build of Perl. If you need comprehensive emulation of <font
- size="-1">UNIX</font> under Win32, you should build it under an
- environment that provides <font size="-1">UNIX</font>
- emulation.</p>
-
- <p>At one time, many modules and extensions did not work under
- Win32 because of UNIXisms in the code and incompatibilities in
- Perl for Win32. This has changed significantly (on both sides
- of the equation), and a large majority of modules now work with
- a native version of Perl for Win32.</p>
-
- <p>You can use the following <font size="-1">C</font> compilers
- to build a native Win32 build of Perl:</p>
-
- <dl>
- <dt><strong><a name="item_Microsoft">Microsoft's Visual C++
- (commercial product)</a></strong></dt>
-
- <dd>
- <p>The Microsoft compiler, which includes compilation
- tools, <font size="-1">API</font> and tool documentation,
- and an integrated development environment.</p>
- <br />
- <pre>
- <a href=
- "http://www.microsoft.com/visualc/">http://www.microsoft.com/visualc/</a>
- </pre>
- </dd>
-
- <dt><strong><a name="item_Borland">Borland C++ Builder
- (commercial product)</a></strong></dt>
-
- <dd>
- <p>Borland <font size="-1">C++</font> provides an
- integrated development environment, compilation tools, and
- documentation for building Win32 applications.</p>
- <br />
- <pre>
- <a href=
- "http://www.inprise.com/bcppbuilder/">http://www.inprise.com/bcppbuilder/</a>
- </pre>
- </dd>
-
- <dt><strong><a name="item_The">Mingw32 Libraries with GCC or
- EGCS Compilers (free software)</a></strong></dt>
-
- <dd>
- <p><font size="-1">GCC</font> and <font size="-1">
- EGCS</font> are both high quality freeware compilers that
- have been ported to the Win32 platform. Together with the
- freely available Mingw32 libraries, they can be used to
- build Perl and extensions. They do not provide an
- integrated development environment, and all of the tools
- must be run from the command line. The Mingw32 library
- reuses some of the code developed for Cygwin32 (see
- below).</p>
-
- <p> EGCS/Mingw32 binaries can be obtained from:</p>
- <br />
- <pre>
- <a href=
- "ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/">ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/</a>
- </pre>
-
- <p> GCC/Mingw32 binaries are available at:</p>
- <br />
- <pre>
- <a href=
- "http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/">http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/</a>
- </pre>
- </dd>
-
- <dt><strong><a name="item_Cygwin32">Cygwin32 (free
- software)</a></strong></dt>
-
- <dd>
- <p>You can approximate a <font size="-1">UNIX</font>
- development and execution environment on Win32 with the
- Cygwin32 toolchain. This is a port of numerous <font size=
- "-1">GNU</font> tools, and includes an emulation <font
- size="-1">API</font> that provides access to many <font
- size="-1">UNIX</font> features not found on Win32:</p>
- <br />
- <pre>
- <a href=
- "http://www.cygnus.com/misc/gnu-win32">http://www.cygnus.com/misc/gnu-win32</a>
- </pre>
- </dd>
- </dl>
- <br />
- <hr />
-
- <h1><a name="AUTHOR_AND_COPYRIGHT">AUTHOR AND
- COPYRIGHT</a></h1>
-
- <p>This <font size="-1">FAQ</font> was originally assembled and
- maintained by Evangelo Prodromou. <a href=
- "mailto:evangelo@endcontsw.com">evangelo@endcontsw.com.</a> It
- has been revised and updated by Brian Jepson of O'Reilly and
- Associates, and David Grove and David Dmytryshyn of
- ActiveState.</p>
-
- <p>This <font size="-1">FAQ</font> is in the public domain. If
- you use it, however, please ensure that you give credit to the
- original authors.</p>
-
- <p> <!-- beginning of leaf footer--></p>
-
- <table width="100%">
- <tr>
- <td bgcolor="000000" width="70" height="31"><a href=
- "http://www.activestate.com/"><img src="ASbutton.gif" alt=
- "ActiveState Home Page" border="0" width="68" height=
- "30" /></a></td>
-
- <td width="10"> </td>
-
- <td valign="middle" bgcolor="#cc0066"><font face=
- "sans-serif" size="+1" color="#ff99cc">
- Win32 FAQ</font></td>
- </tr>
- </table>
- <!-- end of leaf footer-->
- </body>
- </html>
-
-