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

📄 perl1.htm

📁 一个教你学Perl语言的中文教程
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<title>ChinaPerl</title>
<LINK rel="stylesheet" href="mystyle.css" type="text/css">
</head>
<body>

<table border="0" cellspacing="0" bgcolor="#80FFFF" width="100%">
<tr>
  <td align="left" rowspan="2" width="1%">
    <img src="../images/logo.gif" height="106">
  </td>
  <td align="center">
    <img src="../images/title.gif" height="80">
  </td>
</tr>
<tr bgcolor="#00FF80">
  <td colspan="2" align="center">
    Perl教程 |
    软件下载 |
    <a target="_blank" href="http://www.turbolinux.com.cn/cgi-bin/linux/wwwthreads.pl?action=list&Board=perl"> Perl论坛</a> |
    推荐站点 |
    关于我们
  </td>
</tr>
</table>
<br>
<table border="0" width="100%" height="400" cellspacing="0" cellpadding="0">
  <tr>
    <td width="20%" valign="top" bgcolor="#dddddd">
     <table border="0" width="100%" cellpadding="0">
	<tr>
	  <td width="5%">
	  </td>
	  <td width="95%">
<p align="center">Perl 5教程<br>
<a target="_blank" href="http://flamephoenix.126.com">by flamephoenix</a></p>
<p align="center">目录</p>
<p align="center">第一部分  Perl语言</p>
<p><a href="perl1.htm">第一章 概述</a></p>
<p><a href="perl2.htm">第二章 简单变量</a></p>
<p><a href="perl3.htm">第三章 操作符</a></p>
<p><a href="perl4.htm">第四章 列表和数组变量 </a></p>
<p><a href="perl5.htm">第五章 文件读写 </a></p>
<p><a href="perl6.htm">第六章 模式匹配</a></p>
<p><a href="perl7.htm">第七章 控制结构</a></p>
<p><a href="perl8.htm">第八章 子程序</a></p>
<p><a href="perl9.htm">第九章 关联数组(哈希表)</a></p>
<p><a href="perl10.htm">第十章 格式化输出</a></p>
<p><a href="perl11.htm">第十一章 文件系统</a></p>
<p><a href="perl12.htm">第十二章 引用(指针)</a></p>
<p><a href="perl13.htm">第十三章 面向对象编程</a></p>
<p><a href="perl14.htm">第十四章 包和模块</a></p>
<p><a href="func.htm">附录一 函数集</a></p>
<p align="center">第二部分 Perl的CGI应用</p>
<p><a href="cgi1.htm">第一章 cgilib例</a></p>
<p><a href="cgi2.htm">第二章 动态创建图像</a></p>
<p><a href="cgi3.htm">第三章 计数器的编写方法</a></p>
<p><a href="cgi4.htm">第四章 Web Server设置</a></p>
第五章、...<br>
	  </td>
	</tr>
      </table>
    </td>
    <td width="80%" valign="top">
     <table border="0" width="100%" cellpadding="0">
	<tr>
	  <td width="1%">
	  </td>
	  <td width="99%">
<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perl是Practical
Extraction and Report Language的缩写,它是由Larry Wall设计的,并由他不断更新和维护,用于在UNIX环境下编程。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Perl具有高级语言(如C)的强大能力和灵活性。事实上,你将看到,它的许多特性是从C语言中借用来的。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.与脚本语言一样,Perl不需要编译器和链接器来运行代码,你要做的只是写出程序并告诉Perl来运行而已。这意味着Perl对于小的编程问题的快速解决方案和为大型事件创建原型来测试潜在的解决方案是十分理想的。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Perl提供脚本语言(如sed和awk)的所有功能,还具有它们所不具备的很多功能。Perl还支持sed到Perl及awd到Perl的翻译器。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;简而言之,Perl象C一样强大,象awk、sed等脚本描述语言一样方便。<br>
<a name="2、Perl在哪里?">二、Perl在哪里?</a><strong><br>
</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perl通常位于/usr/local/bin/perl或/usr/bin/perl中。你可以在Internet用匿名FTP免费得到它,如ftp://prep.ai.mit.edu/pub/gnu/perl-5.004.tar.gz。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;安装过程为:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1)解压:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$gunzip perl-5.004.tar.gz<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$tar xvf perl-5.004.tar.gz<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(2)配置:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$Configure <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(3)编译:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$make<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$make test<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$make install<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(3)放置:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将编译生成的可执行文件拷贝到可执行文件通常所在目录,如:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$copy &lt;compiled excutable
file&gt; /usr/local/bin/perl<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:这需要系统管理员权限。<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用文本编辑器编辑好你的Perl程序,加上可执行属性:$chmod
+x &lt;program&gt;就可以执行了:$./&lt;program&gt;。如果系统提示:&quot;/usr/local/bin/perl
not found&quot;,则说明你没有安装成功,请重新安装。<br>
注:你的程序的第一行必须为#!/usr/local/bin/perl(perl所在位置)。<br>
<a name="4、注释:">四、注释:</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注释的方法为在语句的开头用字符#,如:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# this line is a comment<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:建议经常使用注释使你的程序易读,这是好的编程习惯。<br>
<br>

<p align="center"><a href="perl2.htm">下一章</a> <a href="index.htm">目录</a></p>
  	  </td>
      </tr>        
      </table>
    </td>
  </tr>
</table>

</body>
</html>

⌨️ 快捷键说明

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