📄 ch24.htm
字号:
</BLOCKQUOTE>
<P>
<TT><FONT FACE="Courier">Man</FONT></TT> pages are available for
individual <TT><FONT FACE="Courier">pod</FONT></TT> files via
this command:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">pod2man myfile.pod | nroff -man | less</FONT></TT>
</BLOCKQUOTE>
<P>
Actually, if you're given a <TT><FONT FACE="Courier">.pod</FONT></TT>
file, running the <TT><FONT FACE="Courier">pod2html</FONT></TT>
command produces HTML files for you to peruse. I find that it's
easier to search and read these HTML files using a Web browser
than it is to mess around with TeX and <TT><FONT FACE="Courier">man</FONT></TT>
page files.
<H3><A NAME="ConfirmingtheInstallation"><B>Confirming the Installation</B></A>
</H3>
<P>
To confirm that you've indeed installed Perl on your machine,
type the <TT><FONT FACE="Courier">perl -v </FONT></TT>command.
You should see the output shown here:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">$ <B>which perl<BR>
</B>/usr/bin/perl<BR>
$ <B>perl -v<BR>
<BR>
</B>This is perl, version 5.002<BR>
<BR>
Copyright 1987-1996, Larry Wall<BR>
</FONT></TT>
</BLOCKQUOTE>
<BLOCKQUOTE>
<TT><FONT FACE="Courier">Perl may be copied only under the terms
of either the Artistic License or the GNU General Public License,
which may be found in the Perl 5.0 source kit.</FONT></TT>
</BLOCKQUOTE>
<H2><A NAME="TheDOSPlatform"><B><FONT SIZE=5 COLOR=#FF0000>The
DOS Platform</FONT></B></A></H2>
<P>
A beta version of Perl based on the Perl 5.000 version is available
in binary form only, from this site in Canada:
<BLOCKQUOTE>
<TT><FONT FACE="Courier"><A HREF="ftp://ftp.ee.umanitoba.ca/815097600/0-672/0-672-30891-6/://pub/msdos/perl/perl5" tppabs="ftp://ftp.ee.umanitoba.ca/815097600/0-672/0-672-30891-6/://pub/msdos/perl/perl5">ftp://ftp.ee.umanitoba.ca://pub/msdos/perl/perl5</A>.</FONT></TT>
</BLOCKQUOTE>
<P>
The <TT><FONT FACE="Courier">perl5a.README</FONT></TT> file with
this version of Perl has a very ominous warning message with it.
The message reads verbatim:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">THIS VERSION MAY HAVE BUGS, AND HAS A
HIGHER THAN "USUAL" chAncE OF CORRUPTING</FONT></TT>
<TT><FONT FACE="Courier">YOUR DISK. BACK UP YOUR HARD DISK BEFORE
USING THIS VERSION.<BR>
</FONT></TT>
</BLOCKQUOTE>
<BLOCKQUOTE>
<TT><FONT FACE="Courier">REPEAT: BACK UP YOUR HARD DISK BEFORE
USING THIS VERSION!<BR>
</FONT></TT>
</BLOCKQUOTE>
<BLOCKQUOTE>
<TT><FONT FACE="Courier">-r--r--r-- 1 bin bin 1170891
Oct 28 09:37 perl5a1.zip<BR>
-r--r--r-- 1 bin bin 1198985
Oct 28 09:37 perl5a2.zip<BR>
-r--r--r-- 1 bin bin 575899
Oct 28 09:37 perl5a3.zip<BR>
<BR>
This is, basically, a snapshot of my sources and executables,
and is intended for use by people who want a "preview"
of what I'm doing. It is not intended for production work, although
I imagine that some people may want to use it for that. You must
get all three .zip files. The sources and executables are all
mixed together with these files, and I have not yet made an attempt
at creating a minimal "binaries + support files" package.</FONT></TT>
</BLOCKQUOTE>
<P>
This was enough to warn me not to install them on my machine.
I'm still happy with <TT><FONT FACE="Courier">perl4</FONT></TT>
with DOS, thank you very much. If you're a hotshot, be my guest.
For more information about this port, please contact the author,
Darryl Okahata, at <TT><FONT FACE="Courier">darrylo@sr.hp.com</FONT></TT>.
The versions under development include those for DOS and Microsoft
windows. If you feel that you must work with Perl 5 features and
have to work under DOS, you're stuck. Perhaps you should consider
installing Windows 95 or NT on your machine and running the version
of Perl 5 for Windows NT. Please see <A HREF="ch9.htm" tppabs="http://www.mcp.com/815097600/0-672/0-672-30891-6/ch9.htm" >Chapter 9</A>,
"Portability Issues with Windows and Perl."
<H2><A NAME="OtherPlatforms"><B><FONT SIZE=5 COLOR=#FF0000>Other
Platforms</FONT></B></A></H2>
<P>
Perl 5 is being ported to other platforms and is at various stages
of development. Some common platforms are listed here. You should
check out these locations. In general though, you'll find only
binary files and not the sources.
<P>
I found the following ports in various stages of development at
the FTP site <TT><FONT FACE="Courier">ftp.funet.fi</FONT></TT>:
<UL>
<LI>Amiga
<LI>Atari
<LI>Lynx OS
<LI>Macintosh
<LI><FONT COLOR=#000000>MS-DOS.</FONT>
<LI>MVS
<LI>NetWare
<LI>OS/2
<LI>QNX
<LI>Windows 3.11, 95, and NT
<LI>Xenix
</UL>
<P>
Check the directories in <TT><FONT FACE="Courier">/pub/languages/perl/CPAN/ports</FONT></TT>.
There may be other levels of subdirectories below these directories.
Some have documentation, some source only, and some complete packages.
For example, the <TT><FONT FACE="Courier">winNT</FONT></TT> subdirectory
has a <TT><FONT FACE="Courier">Perl 5.001m</FONT></TT> port in
<TT><FONT FACE="Courier">./winNT/perl5/perl5.001m</FONT></TT>,
whereas the <TT><FONT FACE="Courier">amiga</FONT></TT> directory
just has one file in it. As you can see, there is considerable
effort being put into porting this powerful language to other
platforms.<P>
<CENTER>
<TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%>
<TR VALIGN=TOP><TD ><B>Note</B></TD></TR>
<TR VALIGN=TOP><TD >
<BLOCKQUOTE>
Please see <A HREF="ch9.htm" tppabs="http://www.mcp.com/815097600/0-672/0-672-30891-6/ch9.htm" >Chapter 9</A>, "Portability Issues with Windows and Perl," for complete installation instructions and discussion of available features of Perl for Windows.
</BLOCKQUOTE>
</TD></TR>
</TABLE></CENTER>
<P>
<H2><A NAME="LinuxASpecialCaseforPerl5"><B><FONT SIZE=5 COLOR=#FF0000>Linux:
A Special Case for Perl 5</FONT></B></A></H2>
<P>
Notably missing from the previous list is the Linux operating
system. With the Linux operating system, you'll need the Executable
and Linking Format (ELF) binaries to use the dynamic loading features
in Perl. All major releases of the Linux kernel and libraries
will support the ELF format in the future. If you do not have
ELF binaries, you might be left behind. The motivation for going
to ELF is simple: The sheer size of static libraries makes it
very prohibitive to construct small applications anymore. Also,
the current <TT><FONT FACE="Courier">a.out</FONT></TT> format
for libraries does not permit the use of the dynamic loading function
<TT><FONT FACE="Courier">dlopen()</FONT></TT>. Using dynamic loading
is critical for the newer programs that are coming out for newer
UNIX and UNIX clone systems.
<P>
The way to tell whether you are already running ELF binaries is
to compile a short program and then run the <TT><FONT FACE="Courier">file</FONT></TT>
command on it. The ensuing output from the <TT><FONT FACE="Courier">file</FONT></TT>
command should be the following if you are running the ELF binaries:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">$ <B>file `which gcc`<BR>
</B>/usr/bin/gcc: ELF 32-bit LSB executable I386 (386 and up)
Version 1.</FONT></TT>
</BLOCKQUOTE>
<P>
Also, check the version numbers on your Linux kernel. Type the
following command to check to see what your version number is.
The non-ELF binaries will be located in the 1.2.13 version. Most
versions after 1.3.18 are ELF compatible:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">$ <B>file `which perl`<BR>
</B>/usr/bin/perl: ELF 32-bit LSB executable i386 (386 and up)
Version 1</FONT></TT>
</BLOCKQUOTE>
<P>
On ordering a Linux distribution and after going through the normal
installation process, I found that my system defaulted to 1.2.13
and no option on the installation screen allowed me the choice
to switch to an ELF system. Newer releases of Linux (March 1996
and later) give you options to install ELF binaries and source
files.
<P>
You can build the ELF kernel using the existing kernel and <TT><FONT FACE="Courier">gc</FONT></TT>
binaries. In order to build the binaries, you have to have the
following items:
<UL>
<LI><FONT COLOR=#000000>A binary ELF </FONT><TT><FONT FACE="Courier">gcc</FONT></TT>
compiler
<LI><FONT COLOR=#000000>The Linux source tree in a </FONT><TT><FONT FACE="Courier">tar</FONT></TT>
file
</UL>
<P>
The binary ELF compiler, <TT><FONT FACE="Courier">gcc</FONT></TT>,
is available from <TT><FONT FACE="Courier">sunsite.unc.edu</FONT></TT>.
The files are located in the Linux <TT><FONT FACE="Courier">/packages/Gcc</FONT></TT>
directory on most Internet sites. The latest version of the <TT><FONT FACE="Courier">gcc</FONT></TT>
compiler is 2.7.2. The binary files can be downloaded from the
Internet and unzipped in the root directory. (The <TT><FONT FACE="Courier">ELF-HOWTO</FONT></TT>
file is correct in this regard.) Just get the <TT><FONT FACE="Courier">gcc</FONT></TT>
binary files and read the instructions on how to unzip, untar,
and install the binary files.
<P>
To unbundle all the source files, you need the file <TT><FONT FACE="Courier">linux-1.3.<I>xx</I>.tar.gz</FONT></TT>.
The <TT><I><FONT FACE="Courier">xx</FONT></I></TT> in my case
is 20; however, by the time this book goes to print, a newer release
might be out. (It's probably in your best interest to get the
latest release from the Internet archives.) Next, go over to the
<TT><FONT FACE="Courier">/usr/src</FONT></TT> directory and, as
root, unzip and untar this source file you have just downloaded.
After untarring the files, your directories should look very close
to this:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">total 113<BR>
drwxr-xr-x 6 root root 1024
Feb 10 02:22 .<BR>
drwxr-xr-x 18 root root 1024
Feb 10 03:38 ..<BR>
-rw-r--r-- 1 root root 107229
Aug 3 1995 ftape-2.03b.tar.gz<BR>
drwxr-xr-x 2 root root 1024
Feb 10 02:11 ghostscript-2.6.2<BR>
lrwxrwxrwx 1 root root 12
Feb 10 02:20 linux -> linux-1.3.20<BR>
drwxr-xr-x 14 root root 1024
Feb 10 13:21 linux-1.3.20<BR>
drwxr-xr-x 3 root root 1024
Feb 10 02:23 sendmail<BR>
drwxr-xr-x 6 root users 2048
Feb 10 02:12 term-2.3.5</FONT></TT>
</BLOCKQUOTE>
<P>
Now confirm that your <TT><FONT FACE="Courier">gcc</FONT></TT>
is installed correctly. Type the following command to see whether
the version number is correct. The ensuing version from the following
command should be 2.7.0 or higher. If you downloaded the binaries
from <TT><FONT FACE="Courier">tsx-11.mit.edu</FONT></TT>, the
version will be 2.7.2:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">$ <B>gcc -v<BR>
</B>Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.0/specs
<BR>
gcc version 2.7.0</FONT></TT>
</BLOCKQUOTE>
<P>
Now create the kernel using the following commands, in this order:
<BLOCKQUOTE>
<TT><FONT FACE="Courier">cd /usr/src/linux<BR>
make depend<BR>
make config<BR>
make clean<BR>
make zlilo</FONT></TT>
</BLOCKQUOTE>
<P>
Depending on the type of pc you have, each command will take some
time-so be prepared to wait. After you have made the kernel, copy
it to the root. Then run setup to reinstall LILO an
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -