perlos2.html
来自「perl教程」· HTML 代码 · 共 1,320 行 · 第 1/5 页
HTML
1,320 行
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',2);</script>
<h1><a>perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.</a></h1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#target">Target</a></li>
<li><a href="#other_oses">Other OSes</a></li>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#starting_perl_programs_under_os_2__and_dos_and____">Starting Perl programs under OS/2 (and DOS and...)</a></li>
<li><a href="#starting_os_2__and_dos__programs_under_perl">Starting OS/2 (and DOS) programs under Perl</a></li>
</ul>
<li><a href="#frequently_asked_questions">Frequently asked questions</a></li>
<ul>
<li><a href="#it_does_not_work">"It does not work"</a></li>
<li><a href="#i_cannot_run_external_programs">I cannot run external programs</a></li>
<li><a href="#i_cannot_embed_perl_into_my_program__or_use_perl_dll_from_my">I cannot embed perl into my program, or use <em>perl.dll</em> from my</a></li>
<li><a href="#___and_pipeopen_do_not_work_under_dos_"><code>``</code> and pipe-<a href="../../lib/Pod/perlfunc.html#item_open"><code>open</code></a> do not work under DOS.</a></li>
<li><a href="#cannot_start_find_exe_pattern_file">Cannot start <code>find.exe "pattern" file</code></a></li>
</ul>
<li><a href="#installation">INSTALLATION</a></li>
<ul>
<li><a href="#automatic_binary_installation">Automatic binary installation</a></li>
<li><a href="#manual_binary_installation">Manual binary installation</a></li>
<li><a href="#warning"><strong>Warning</strong></a></li>
</ul>
<li><a href="#accessing_documentation">Accessing documentation</a></li>
<ul>
<li><a href="#os_2__inf_file">OS/2 <em>.INF</em> file</a></li>
<li><a href="#plain_text">Plain text</a></li>
<li><a href="#manpages">Manpages</a></li>
<li><a href="#html">HTML</a></li>
<li><a href="#gnu_info_files">GNU <code>info</code> files</a></li>
<li><a href="#pdf_files"><em>PDF</em> files</a></li>
<li><a href="#latex_docs"><code>LaTeX</code> docs</a></li>
</ul>
<li><a href="#build">BUILD</a></li>
<ul>
<li><a href="#the_short_story">The short story</a></li>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#getting_perl_source">Getting perl source</a></li>
<li><a href="#application_of_the_patches">Application of the patches</a></li>
<li><a href="#handediting">Hand-editing</a></li>
<li><a href="#making">Making</a></li>
<li><a href="#testing">Testing</a></li>
<li><a href="#installing_the_built_perl">Installing the built perl</a></li>
<li><a href="#a_outstyle_build"><code>a.out</code>-style build</a></li>
</ul>
<li><a href="#building_a_binary_distribution">Building a binary distribution</a></li>
<li><a href="#building_custom__exe_files">Building custom <em>.EXE</em> files</a></li>
<ul>
<li><a href="#making_executables_with_a_custom_collection_of_statically_loaded_extensions">Making executables with a custom collection of statically loaded extensions</a></li>
<li><a href="#making_executables_with_a_custom_searchpaths">Making executables with a custom search-paths</a></li>
</ul>
<li><a href="#build_faq">Build FAQ</a></li>
<ul>
<li><a href="#some___became___in_pdksh_">Some <code>/</code> became <code>\</code> in pdksh.</a></li>
<li><a href="#_errno___unresolved_external"><code>'errno'</code> - unresolved external</a></li>
<li><a href="#problems_with_tr_or_sed">Problems with tr or sed</a></li>
<li><a href="#some_problem__forget_which___">Some problem (forget which ;-)</a></li>
<li><a href="#library_____not_found">Library ... not found</a></li>
<li><a href="#segfault_in_make">Segfault in make</a></li>
<li><a href="#op_sprintf_test_failure">op/sprintf test failure</a></li>
</ul>
<li><a href="#specific__mis_features_of_os_2_port">Specific (mis)features of OS/2 port</a></li>
<ul>
<li><a href="#setpriority__getpriority"><a href="../../lib/Pod/perlfunc.html#item_setpriority"><code>setpriority</code></a>, <a href="../../lib/Pod/perlfunc.html#item_getpriority"><code>getpriority</code></a></a></li>
<li><a href="#system__"><a href="../../lib/Pod/perlfunc.html#item_system"><code>system()</code></a></a></li>
<li><a href="#extproc_on_the_first_line"><code>extproc</code> on the first line</a></li>
<li><a href="#additional_modules_">Additional modules:</a></li>
<li><a href="#prebuilt_methods_">Prebuilt methods:</a></li>
<li><a href="#prebuilt_variables_">Prebuilt variables:</a></li>
<li><a href="#misfeatures">Misfeatures</a></li>
<li><a href="#modifications">Modifications</a></li>
<li><a href="#identifying_dlls">Identifying DLLs</a></li>
<li><a href="#centralized_management_of_resources">Centralized management of resources</a></li>
</ul>
<li><a href="#perl_flavors">Perl flavors</a></li>
<ul>
<li><a href="#perl_exe"><em>perl.exe</em></a></li>
<li><a href="#perl__exe"><em>perl_.exe</em></a></li>
<li><a href="#perl___exe"><em>perl__.exe</em></a></li>
<li><a href="#perl____exe"><em>perl___.exe</em></a></li>
<li><a href="#why_strange_names">Why strange names?</a></li>
<li><a href="#why_dynamic_linking">Why dynamic linking?</a></li>
<li><a href="#why_chimera_build">Why chimera build?</a></li>
</ul>
<li><a href="#environment">ENVIRONMENT</a></li>
<ul>
<li><a href="#perllib_prefix"><code>PERLLIB_PREFIX</code></a></li>
<li><a href="#perl_badlang"><code>PERL_BADLANG</code></a></li>
<li><a href="#perl_badfree"><code>PERL_BADFREE</code></a></li>
<li><a href="#perl_sh_dir"><code>PERL_SH_DIR</code></a></li>
<li><a href="#use_perl_flock"><code>USE_PERL_FLOCK</code></a></li>
<li><a href="#tmp_or_temp"><code>TMP</code> or <code>TEMP</code></a></li>
</ul>
<li><a href="#evolution">Evolution</a></li>
<ul>
<li><a href="#textmode_filehandles">Text-mode filehandles</a></li>
<li><a href="#priorities">Priorities</a></li>
<li><a href="#dll_name_mangling__pre_5_6_2">DLL name mangling: pre 5.6.2</a></li>
<li><a href="#dll_name_mangling__5_6_2_and_beyond">DLL name mangling: 5.6.2 and beyond</a></li>
<li><a href="#dll_forwarder_generation">DLL forwarder generation</a></li>
<li><a href="#threading">Threading</a></li>
<li><a href="#calls_to_external_programs">Calls to external programs</a></li>
<li><a href="#memory_allocation">Memory allocation</a></li>
<li><a href="#threads">Threads</a></li>
</ul>
<li><a href="#bugs">BUGS</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT.</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>One can read this document in the following formats:</p>
<pre>
man <a href="../../lib/Pod/perlos2.html">perlos2</a>
view perl <a href="../../lib/Pod/perlos2.html">perlos2</a>
explorer <a href="../../lib/Pod/perlos2.html">perlos2</a>.html
info <a href="../../lib/Pod/perlos2.html">perlos2</a></pre>
<p>to list some (not all may be available simultaneously), or it may
be read <em>as is</em>: either as <em>README.os2</em>, or <em>pod/perlos2.pod</em>.</p>
<p>To read the <em>.INF</em> version of documentation (<strong>very</strong> recommended)
outside of OS/2, one needs an IBM's reader (may be available on IBM
ftp sites (?) (URL anyone?)) or shipped with PC DOS 7.0 and IBM's
Visual Age C++ 3.5.</p>
<p>A copy of a Win* viewer is contained in the "Just add OS/2 Warp" package</p>
<pre>
<a href="ftp://ftp.software.ibm.com/ps/products/os2/tools/jaow/jaow.zip">ftp://ftp.software.ibm.com/ps/products/os2/tools/jaow/jaow.zip</a></pre>
<p>in <em>?:\JUST_ADD\view.exe</em>. This gives one an access to EMX's
<em>.INF</em> docs as well (text form is available in <em>/emx/doc</em> in
EMX's distribution). There is also a different viewer named xview.</p>
<p>Note that if you have <em>lynx.exe</em> or <em>netscape.exe</em> installed, you can follow WWW links
from this document in <em>.INF</em> format. If you have EMX docs installed
correctly, you can follow library links (you need to have <code>view emxbook</code>
working by setting <code>EMXBOOK</code> environment variable as it is described
in EMX docs).</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>
</p>
<h2><a name="target">Target</a></h2>
<p>The target is to make OS/2 one of the best supported platform for
using/building/developing Perl and <em>Perl applications</em>, as well as
make Perl the best language to use under OS/2. The secondary target is
to try to make this work under DOS and Win* as well (but not <strong>too</strong> hard).</p>
<p>The current state is quite close to this target. Known limitations:</p>
<ul>
<li>
<p>Some *nix programs use <a href="../../lib/Pod/perlfunc.html#item_fork"><code>fork()</code></a> a lot; with the mostly useful flavors of
perl for OS/2 (there are several built simultaneously) this is
supported; but some flavors do not support this (e.g., when Perl is
called from inside REXX). Using <a href="../../lib/Pod/perlfunc.html#item_fork"><code>fork()</code></a> after
<em>use</em>ing dynamically loading extensions would not work with <em>very</em> old
versions of EMX.</p>
</li>
<li>
<p>You need a separate perl executable <em>perl__.exe</em> (see <em>perl__.exe</em>)
if you want to use PM code in your application (as Perl/Tk or OpenGL
Perl modules do) without having a text-mode window present.</p>
<p>While using the standard <em>perl.exe</em> from a text-mode window is possible
too, I have seen cases when this causes degradation of the system stability.
Using <em>perl__.exe</em> avoids such a degradation.</p>
</li>
<li>
<p>There is no simple way to access WPS objects. The only way I know
is via <code>OS2::REXX</code> and <code>SOM</code> extensions (see <a href="../../OS2/REXX.html">the OS2::REXX manpage</a>, <em>Som</em>).
However, we do not have access to
convenience methods of Object-REXX. (Is it possible at all? I know
of no Object-REXX API.) The <code>SOM</code> extension (currently in alpha-text)
may eventually remove this shortcoming; however, due to the fact that
DII is not supported by the <code>SOM</code> module, using <code>SOM</code> is not as
convenient as one would like it.</p>
</li>
</ul>
<p>Please keep this list up-to-date by informing me about other items.</p>
<p>
</p>
<h2><a name="other_oses">Other OSes</a></h2>
<p>Since OS/2 port of perl uses a remarkable EMX environment, it can
run (and build extensions, and - possibly - be built itself) under any
environment which can run EMX. The current list is DOS,
DOS-inside-OS/2, Win0.3*, Win0.95 and WinNT. Out of many perl flavors,
only one works, see <a href="#perl__exe">perl_.exe</a>.</p>
<p>Note that not all features of Perl are available under these
environments. This depends on the features the <em>extender</em> - most
probably RSX - decided to implement.</p>
<p>Cf. <em>Prerequisites</em>.</p>
<p>
</p>
<h2><a name="prerequisites">Prerequisites</a></h2>
<dl>
<dt><strong><a name="item_emx">EMX</a></strong>
<dd>
<p>EMX runtime is required (may be substituted by RSX). Note that
it is possible to make <em>perl_.exe</em> to run under DOS without any
external support by binding <em>emx.exe</em>/<em>rsx.exe</em> to it, see <em>emxbind</em>. Note
that under DOS for best results one should use RSX runtime, which
has much more functions working (like <a href="../../lib/Pod/perlfunc.html#item_fork"><code>fork</code></a>, <a href="#item_popen"><code>popen</code></a> and so on). In
fact RSX is required if there is no VCPI present. Note the
RSX requires DPMI. Many implementations of DPMI are known to be very
buggy, beware!</p>
</dd>
<dd>
<p>Only the latest runtime is supported, currently <code>0.9d fix 03</code>. Perl may run
under earlier versions of EMX, but this is not tested.</p>
</dd>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?