⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch02_03.htm

📁 by Randal L. Schwartz and Tom Phoenix ISBN 0-596-00132-0 Third Edition, published July 2001. (See
💻 HTM
📖 第 1 页 / 共 2 页
字号:
Perl for Win32 from the same source kit that their Unix counterpartsused. In addition, the Perl build mechanism for Win32 began tosupport more than just commercial development toolkits, such asMicrosoft's Visual C++. A Perl developer who wantedto build the Perl source kit with a free development toolkit couldbuild Perl with<a name="INDEX-62" />Cygwin (<a href="http://www.cygnus.com">www.cygnus.com</a>), a Unix layer on top ofWin32, or <a name="INDEX-63" />Mingw32(<a href="http://www.mingw.org">www.mingw.org</a>) with<i class="command">dmake</i>, a set of Win32 runtime libraries thatprovide a Unix emulation under native Win32.</p><a name="ch02-6-fm2xml" /><blockquote><b>TIP:</b> Unless there's something specific that you gain bybuilding your own Perl for Win32, then you should use the Activestatebuild, ActivePerl.</p></blockquote><a name="perlnut2-CHP-2-SECT-3.2.1" /><div class="sect3"><h3 class="sect3">2.3.2.1. ActivePerl</h3><p>The canonical source for the <a name="INDEX-64" />ActivePerl distribution at the timeof this writing is at <a href="http://aspn.activestate.com/ASPN/Downloads/ActivePerl/">http://aspn.activestate.com/ASPN/Downloads/ActivePerl/</a>.Included in the distribution are:</p><dl><dt><i><em class="emphasis">Perl for Win32</em></i></dt><dd>Binary for the core Perl distribution</p></dd><dt><i><em class="emphasis">Perl for ISAPI</em></i></dt><dd>IIS plug-in for use with ISAPI-compliant web servers</p></dd><dt><i><em class="emphasis">PerlScript</em></i></dt><dd>ActiveX scripting engine</p></dd><dt><i><em class="emphasis">Perl Package Manager</em></i></dt><dd>Manager for Perl modules and extensions</p></dd></dl><p><a name="INDEX-65" />The ActivePerl binary comes as aself-extracting executable that uses the standard Win32 InstallShieldsetup wizard to guide you through the installation process. Bydefault, Perl is installed into the directory<em class="emphasis">C:\Perl\version</em>, in which<em class="emphasis">version</em> is the current version number (e.g.,5.005). (For information on customizing your installation, see theWin32 FAQ on the ActiveState web site.) The installation alsoassociates the file extension <em class="emphasis">.pl</em> with Perl andadds the directory into which you installed Perl to your PATHenvironment variable.</p><p>If you want to install ActivePerl, you can do so by running the<em class="emphasis">MSI</em> archive that's shipped byActiveState. If the <em class="emphasis">MSI</em> archive is notassociated with the MSI application, you need to obtain<em class="emphasis">InstMsi.exe</em><a name="INDEX-66" />from the downloads section at <a href="http://www.microsoft.com">www.microsoft.com</a>.</p><p>If you don't (or can't) install MSIon your system, ActiveState has made available a Perl installer thatdoesn't use MSI, but be aware that this installerdoesn't have a corresponding de-installer.</p></div><a name="perlnut2-CHP-2-SECT-3.2.2" /><div class="sect3"><h3 class="sect3">2.3.2.2. Standard Perl distribution</h3><p>The standard Perl distribution is available from CPAN, whereyou'll find binary and source distributions for thecurrent version of Perl. The <a name="INDEX-67" /><a name="INDEX-68" /><a name="INDEX-69" />source distributions come as<em class="emphasis">.tar.gz</em> files, which you can extract using autility that supports <em class="emphasis">gzip</em> files,<em class="emphasis">tar</em> files, and long filenames. Ports of both GNU<em class="emphasis">gzip</em><a name="INDEX-70" /> and<em class="emphasis">tar</em><a name="INDEX-71" /> <a name="INDEX-72" /> are available for the various Win32platforms, or you can use a graphical <em class="emphasis">zip</em>archive program such as WinZip. Make sure you preserve the directorystructure when you unpack the distribution.</p><p>To install from the source, you need the Microsoft Visual C++compiler, the Borland C++ compiler, or<a name="INDEX-73" />Mingw32 with EGCSgcc-2.95.X. If you're using<a name="INDEX-74" />Cygwin32, <em class="emphasis">do not</em> tryto build Perl in the win32 subdirectory. Instead, you should run<em class="emphasis">Configure</em> in the <em class="emphasis">src</em>directory as you would when building under a Unix platform. You alsoneed a <em class="emphasis">make</em> utility. Microsoft Visual C++ comeswith <em class="emphasis">nmake</em>, or you can use<em class="emphasis">dmake</em>.<a href="#FOOTNOTE-3">[3]</a></p><blockquote class="footnote"> <a name="FOOTNOTE-3" /><p> [3]See the<em class="emphasis">README.win32</em> file for information on obtainingMingw32 and a Win32 <em class="emphasis">dmake</em> port.</p></blockquote><p>Once you have the distribution, start by reading the file<em class="emphasis">README.win32</em>. Next, edit the file<em class="emphasis">Makefile</em> in the <em class="emphasis">win32</em>subdirectory of the distribution and make sure thatyou're happy with the values for the install driveand directory. Then execute the following commands from the<em class="emphasis">win32</em> subdirectory of the distribution to build,test, and install the distribution. This example assumes that youhave the proper environment variables (LIB, INCLUDE, etc.) set up foryour compiler and that <em class="emphasis">nmake</em> is your makeprogram.</p><blockquote><pre class="code">C:\&gt; nmake         <em class="emphasis">Build all of Perl</em>C:\&gt; nmake test    <em class="emphasis">Test your distribution</em>C:\&gt; nmake install <em class="emphasis">Install to target directory, as specified in the Makefile</em></pre></blockquote><a name="ch02-8-fm2xml" /><blockquote><b>TIP:</b> If you're running Mingw32, you'lluse <i class="command">dmake</i>, since <i class="command">nmake</i> is partof commercial development suites&#x2014;such as Microsoft VisualC++&#x2014;and is not available separately. </p></blockquote><p>Assuming everythingis now built correctly, you just need to add the<em class="emphasis">bin</em> subdirectory of the installation targetdirectory to your path or to your operating environment underMicrosoft server platforms such as Windows NT. For example, if youinstalled the Perl distribution to <em class="emphasis">C:\Perl</em>,you'll want to add the directory containing<em class="filename">perl.exe</em> (e.g.,<em class="emphasis">C:\Perl\bin</em>) to your path. </p><p>Finally, you should restart your machine so the environmentchanges take effect, and you're ready to go. This isof particular importance if you're running Perlunder Windows 95, 98, or ME. </p><blockquote><b>WARNING:</b> <a name="INDEX-75" /><a name="INDEX-76" />Windows 95/98 users canexpect significantly different functionality from their Perldistribution than Windows NT users. For various reasons, some of theWin32 modules don't work on Windows 95/98. Thefunctionality required to implement them may be missing on Windows95/98, or bugs in Windows 95 may prevent them from workingcorrectly<a name="INDEX-77" /><a name="INDEX-78" />. </p></blockquote></div></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch02_02.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="ch02_04.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">2.2. How Is CPAN Organized?</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">2.4. Getting and Installing Modules</td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright &copy; 2002</a> O'Reilly &amp; Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,85,94" href="../index.htm"><area shape="rect" coords="86,1,178,103" href="../lwp/index.htm"><area shape="rect" coords="180,0,265,103" href="../lperl/index.htm"><area shape="rect" coords="267,0,353,105" href="../perlnut/index.htm"><area shape="rect" coords="354,1,446,115" href="../prog/index.htm"><area shape="rect" coords="448,0,526,132" href="../tk/index.htm"><area shape="rect" coords="528,1,615,119" href="../cookbook/index.htm"><area shape="rect" coords="617,0,690,135" href="../pxml/index.htm"></map></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -