?? 第一章 概述.htm
字號:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<title>Perl教程之 概述</title>
<LINK rel="stylesheet" href="article.css" type="text/css">
</head>
<body>
<br>
<p align="center">第一章 概述</p>
<p align="center"><a target="_blank" href="http://flamephoenix.126.com">by flamephoenix</a></p>
<a href="#1、Perl是什么?">一、Perl是什么?</a><br>
<a href="#2、Perl在哪里?">二、Perl在哪里?</a><br>
<a href="#3、運行">三、運行</a><br>
<a href="#4、注釋:">四、注釋</a></p>
<br>
<a name="1、Perl是什么?">一、Perl是什么?</a><br>
Perl是Practical
Extraction and Report Language的縮寫,它是由Larry Wall設計的,并由他不斷更新和維護,用于在UNIX環境下編程。<br>
.Perl具有高級語言(如C)的強大能力和靈活性。事實上,你將看到,它的許多特性是從C語言中借用來的。<br>
.與腳本語言一樣,Perl不需要編譯器和鏈接器來運行代碼,你要做的只是寫出程序并告訴Perl來運行而已。這意味著Perl對于小的編程問題的快速解決方案和為大型事件創建原型來測試潛在的解決方案是十分理想的。<br>
.Perl提供腳本語言(如sed和awk)的所有功能,還具有它們所不具備的很多功能。Perl還支持sed到Perl及awd到Perl的翻譯器。<br>
簡而言之,Perl象C一樣強大,象awk、sed等腳本描述語言一樣方便。<br>
<a name="2、Perl在哪里?">二、Perl在哪里?</a><strong><br>
</strong> Perl通常位于/usr/local/bin/perl或/usr/bin/perl中。你可以在Internet用匿名FTP免費得到它,如ftp://prep.ai.mit.edu/pub/gnu/perl-5.004.tar.gz。<br>
安裝過程為:<br>
(1)解壓:<br>
$gunzip perl-5.004.tar.gz<br>
$tar xvf -
<perl-5.004.tar.gz<br>
(2)編譯:<br>
$make makefile<br>
(3)放置:<br>
將編譯生成的可執行文件拷貝到可執行文件通常所在目錄,如:<br>
$copy <compiled excutable
file> /usr/local/bin/perl<br>
注:這需要系統管理員權限。<br>
<br>
</p>
<p align="center" aligh="center">北美</p>
<div align="center"><center>
<table border="1" width="70%">
<tr>
<td valign="top" width="192"><i>地址</i></td>
<td valign="top" width="384"><i>目錄</i></td>
</tr>
<tr>
<td valign="top" width="192">ftp.netlabs.com</td>
<td valign="top" width="384">IP地址:192.94.48.152<br>
目錄 /pub/outgoing/perl5.0 </td>
</tr>
<tr>
<td valign="top" width="192">ftp.cis.ufl.edu</td>
<td valign="top" width="384">IP地址:
128.227.100.198<br>
目錄 /pub/perl/src/5.0 </td>
</tr>
<tr>
<td valign="top" width="192">ftp.uu.net</td>
<td valign="top" width="384">IP地址:
192.48.96.9<br>
目錄 /languages/perl </td>
</tr>
<tr>
<td valign="top" width="192">ftp.khoros.unm.edu</td>
<td valign="top" width="384">IP地址:
198.59.155.28<br>
目錄 /pub/perl </td>
</tr>
<tr>
<td valign="top" width="192">ftp.cbi.tamucc.edu</td>
<td valign="top" width="384">IP地址:
165.95.1.3<br>
目錄 /pub/duff/Perl </td>
</tr>
<tr>
<td valign="top" width="192">ftp.metronet.com</td>
<td valign="top" width="384">IP地址:
192.245.137.1<br>
目錄 /pub/perl/sources </td>
</tr>
<tr>
<td valign="top" width="192">genetics.upenn.edu</td>
<td valign="top" width="384">IP地址:
128.91.200.37<br>
目錄 /perl5 </td>
</tr>
</table>
</center></div>
<p align="center">歐洲</p>
<div align="center"><center>
<table border="1" width="70%">
<tr>
<td valign="top" width="192"><i>Site</i></td>
<td valign="top" width="384"><i>Location</i>
</td>
</tr>
<tr>
<td valign="top" width="192">ftp.cs.ruu.nl</td>
<td valign="top" width="384">IP地址:
131.211.80.17<br>
目錄 /pub/PERL/perl5.0/src </td>
</tr>
<tr>
<td valign="top" width="192">ftp.funet.fi</td>
<td valign="top" width="384">IP地址:
128.214.248.6<br>
目錄 /pub/languages/perl/ports/perl5 </td>
</tr>
<tr>
<td valign="top" width="192">ftp.zrz.tu-berlin.de</td>
<td valign="top" width="384">IP地址:
130.149.4.40<br>
目錄 /pub/unix/perl </td>
</tr>
<tr>
<td valign="top" width="192">src.doc.ic.ac.uk</td>
<td valign="top" width="384">IP地址:
146.169.17.5<br>
目錄 /packages/perl5 </td>
</tr>
</table>
</center></div>
<p align="center">澳洲<br>
</p>
<div align="center"><center>
<table border="1" width="70%">
<tr>
<td valign="top" width="192"><i>Site</i></td>
<td valign="top" width="384"><i>Location</i>
</td>
</tr>
<tr>
<td valign="top" width="192">sungear.mame.mu.oz.au</td>
<td valign="top" width="384">IP地址:
128.250.209.2<br>
目錄 /pub/perl/src/5.0 </td>
</tr>
</table>
</center></div>
<p align="center">南美</p>
<div align="center"><center>
<table border="1" width="70%">
<tr>
<td valign="top" width="192"><i>Site</i></td>
<td valign="top" width="384"><i>Location</i>
</td>
</tr>
<tr>
<td valign="top" width="192">ftp.inf.utfsm.cl</td>
<td valign="top" width="384">IP地址:
146.83.198.3<br>
目錄 /pub/gnu </td>
</tr>
</table>
</center></div>
<a name="3、運行">三、運行</a><br>
用文本編輯器編輯好你的Perl程序,加上可執行屬性:$chmod
+x <program>就可以執行了:$./<program>。如果系統提示:"/usr/local/bin/perl
not found",則說明你沒有安裝成功,請重新安裝。<br>
注:你的程序的第一行必須為#!/usr/local/bin/perl(perl所在位置)。<br>
<a name="4、注釋:">四、注釋:</a><br>
注釋的方法為在語句的開頭用字符#,如:<br>
# this line is a comment<br>
注:建議經常使用注釋使你的程序易讀,這是好的編程習慣。<br>
<br>
<p align="center"><a href="第二章 簡單變量.htm">下一章</a> <a href="index.htm">目錄</a></p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -