📄 01_3_27_4.asp.html
字号:
<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>计算机世界网-Perl 语言全面编译</TITLE></HEAD>
<style>
.a14{font-size:14px;text-indent:25px;line-height:20px}
.f{font-size:18px;color=#0f3ccd}
img{border:0px;}
td,p,input{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>
<center>
<BODY topmargin=2 leftmargin=0>
<style>
.v12{font-size:10pt;color:"#ffffff";FONT-WEIGHT: bold}
.v14{font-size:14px;text-indent:25px;line-height:20px}
img{border:0px;}
td,p,input,select{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>
<style>
.v13{font-size:10pt;color:"#ffffff";FONT-WEIGHT: bold}
.v12{font-size:13px;color:"#4C029C";FONT-WEIGHT: bold}
.v14{font-size:14px;text-indent:25px;line-height:20px}
img{border:0px;}
td,p,input,select{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>
<!--头-->
<table align=center cellpadding="0" cellspacing="0" border="0" width="767">
<tr><td valign=bottom>
<table cellpadding="0" cellspacing="0" border=0>
<tr><td valign=top><img src="ccwlogo0.gif"></td></tr>
<tr><td height="27" valign=top><img src="knowledg.gif" width="207" height="27"></td></tr>
</table></td>
<td valign=bottom width=556 bgcolor="#4c029c" height=96>
<table cellpadding="0" cellspacing="0" border=0 width=556 bgcolor="#4c029c" height=96>
<tr><td height=25 valign=bottom bgcolor="#ffffff" colspan=2 ><img src="top00000.gif" usemap="#F"></td></tr>
<tr valign=middle >
<td align=center valign=middle height="60" align=center>
<!-- <a href="/search/" target=_blank><img src="/img2/esearch.GIF" border=0 width=468 height=60></a> --><a href="http://www.ccw.com.cn/html/search/thememail/" target=_blank><img src="topbanne.gif" border=0 width=468 height=60></a>
</td>
<td align=center width=15%>
<table width=95%>
<tr><td><a href="mailto:center@ccw.com.cn?subject=%E6%88%91%E8%A6%81%E6%8A%95%E7%A8%BF:" target=_blank><font class=v13>我要投稿</a><br><a href="mailto:center@ccw.com.cn?subject=%E7%BC%96%E8%AF%BB%E5%BE%80%E6%9D%A5"><font class=v13>编读往来</a><br><a href="javascript:AddBookMark('计算机世界网首页')"><font class=v13>加入收藏</a></font></td></tr>
</table>
</td>
</tr>
<tr><td bgcolor="#ffffff" height=1 colspan=2 ></td></tr>
<tr><td bgcolor="#b4aafc" height=2 colspan=2 ></td></tr></table>
<map name="F">
<area href="http://www.ccw.com.cn/" shape="rect" coords="29, 3, 61, 18" target=_blank>
<area href="http://www.ccw.com.cn/news1/" shape="rect" coords="72, 3, 143, 18" target=_blank>
<area href="http://www.ccw.com.cn/center/" shape="rect" coords="155, 2, 216, 18" target=_blank>
<area href="http://www.ccw.com.cn/work/" shape="rect" coords="225, 2, 299, 18" target=_blank>
<area href="http://www.ccw.com.cn/search/" shape="rect" coords="310, 3, 364, 19" target=_blank>
<area href="http://www3.ccw.com.cn/" shape="rect" coords="372, 2, 412, 19" target=_blank>
<area href="http://www2.ccw.com.cn/" shape="rect" coords="424, 2, 550, 18" target=_blank></map>
</td></tr>
<tr><td colspan=2 bgcolor="#b4aafc">
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td width=26% align=center><font class=v12>【2003年2月7日】 </font></td>
<td CLASS=V12> <a href="http://www.ccw.com.cn/center/topic.asp">专 题</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/tech.asp">技 术</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/prod.asp">产 品</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/app.asp">应 用</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/net.asp">网 络</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/prog.asp">编 程</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/skill.asp">技 巧</a> </td>
</tr>
</table>
</td></tr>
</table>
<table align=center width=680>
<tr><td align=center><br><h2><font color='#0f3ccd'>Perl 语言全面编译(一)</font></h2>
<br><b><a href="mailto:tanshuai@BIGFOOT.COM"><font color="#0000FF">天水-S.Tanshuai</font></a></b>
<br><hr size=1 width=660 color=#f46240></td></tr></table><br>
<table align=center width=620><tr><td class=a14>
<p align="left"><b><font size="4">简 述</font></b></p>
</td></tr></table><table align=center width=620><tr><td class=a14>
本文将详细讲述Perl的编译方法,献给所有热爱、喜欢Perl的程序员们。</td></tr></table><table align=center width=620><tr><td class=a14>
Perl自从面世以来1.0版本到现今的5.6版本,一直都有编译程序,主要因为国内的中文资料很少,大多数人不愿意去看或者不懂得英文资料,所造成不知道器编译方法。即使是很多Perl界高手也同样有此类问题。Perl编译方法五花八门,各种编译方法都有其重要的意义和弱点。另一方面Perl编译方法不能流行的原因是,本身Perl就是一个免费的东西,人们不希望Perl成为编译的商品,但是在国内也是因此而拖累了Perl的发展步伐。但在此我不赞成也不推崇Perl程序的编译,Perl编译有小些局限性,但是仍然可以完成所有任务,想要达到良好的编译效果,需要高超的编程技术和相关经验,重要的是对OOP(面向对象的程序设计)的了解,将会使得你的Perl程序更加易于编译,运行速度更快,兼容性更广等特性。</td></tr></table><table align=center width=620><tr><td class=a14>
以前我写过Perl在可嵌入式技术方面技术文章。它的优势和其它嵌入语言无法比拟的兼容性,Perl不但拥有PHP的可嵌入HTML技术,也同样支持用PerlScript写ASP的。但是如果你希望你的程序可以编译执行,那么可嵌入式方法显然是不可能的。我几乎不用ePerl、mod_perl等可嵌入式Perl HTML 页,但是我更不赞成很多人把HTML置入程序之中,这两种方法都有其好处以及坏处。我推崇模板方式的编写方法,大家可能也用过模板方式,可能认为它在页面量处理方面有很多问题?但是,那些都是陈旧古老的方式,也是说明你并未精通Perl语言,采用模板方式调入HTML页是相当好的方法,几乎可以达到所有可嵌入式技术的功效,也可以像HTML程序内置方式的灵活操纵性。我觉得程序员和HTML制作员是不同的,如果我们采用ePerl、PHP、ASP,那么你就不是一个真正的程序员,那只是HTML技术的服务器处理部分罢了,真正的程序是程序本身,而不附带任何其它特性。</td></tr></table><table align=center width=620><tr><td class=a14>
我认为好的教学文章,应该让读者充分了解内容,充分扩展层面。诸如编写一个Httpd程序,有很多传统的程序员根本不了解 http的通讯协议,即使讲了很多内容,但是仍然搞得半懂不懂。本文将会充分扩展层面,让读者了解更多的技术资料,而不必看完本文后又要去寻找关联技术资料。同样国内目前有很多技术性书籍,都是来自国外的译本,但是很多译者并非此技术专家,在翻译的时候很多东西无法充分理解,带来的时间上的障碍。我希望国内的编程专家能够写一些有用的技术文章和书籍,因为我看过很多国人自己写的文章都容易理解和操作。但是问题在于都偏向与基础教学,目前急切地需要有更深层次的技术资料。</td></tr></table><table align=center width=620><tr><td class=a14>
</td></tr></table><table align=center width=620><tr><td class=a14>
<b>
内容大纲:</b></td></tr></table><table align=center width=620><tr><td class=a14>
1) PerlApp和PerlSvc编译方法 <font color="#FF0000">New!</font> <font color="#00FF00"> Easy!</font></td></tr></table><table align=center width=620><tr><td class=a14>
2) Perl2Exe 编译方法</td></tr></table><table align=center width=620><tr><td class=a14>
3) PerlCC 编译方法</td></tr></table><table align=center width=620><tr><td class=a14>
4) PerlCC之Bytecode 编译解析法——Just Like Java Program! <font color="#FF0000"> New!</font>
<font color="#0000FF"> Cool!</font></td></tr></table><table align=center width=620><tr><td class=a14>
5) OOP面向对象的程序之为编译而设计 </td></tr></table><table align=center width=620><tr><td class=a14>
6) HTML模板编程方式——真正的WEB程序(Program) <font color="#0000FF">Good!</font></td></tr></table><table align=center width=620><tr><td class=a14>
7) 联合编译以及实例 <font color="#000080">Advanced!</font></td></tr></table><table align=center width=620><tr><td class=a14>
</td></tr></table><table align=center width=620><tr><td class=a14>
<i>
说明:如何选择阅读以上内容是很重要的,以上内容并非适合各个阶层的Perl程序员。PerlApp和PerlSvc适合在Windows2000环境下编程初学者和一般的Perl程序设计人员,Perl2Exe适合在非Windows和Windows95/98/Me 环境下编程初学者和一般的Perl程序设计人员。PerlCC适合与任何操作系统平台,但是操作复杂,适合于中级程序员和高级程序员开发大宗商业化软件(公众客户)使用。ByteCode是一种新型的编译方式,类似Java,它需要Perl解析器的支持,但是它是灵活性最高的编译方式,适合中级程序员和高级程序员开发大宗商业化软件(服务商)使用。如果你希望你可以编写出一个出色的Perl编译的程序,那么你必须阅读第4节,它将告诉你如何使用面向对象的程序设计技术来实现Perl编译程序的高效良好的开发环境和模式。</i></td></tr></table><table align=center width=620><tr><td class=a14>
</td></tr></table><table align=center width=620><tr><td class=a14>
<p align="left"><b>
<font size="4">
第一节 PerlApp和PerlSvc编译方法</font></b></p>
</td></tr></table><table align=center width=620><tr><td class=a14>
PerlApp和PerlSvc是ActiveState 公司开发的,它属于 Active Perl Dev Kit(PDK)产品。本编译方法只适合于Windows2000上运行,其它系统均无法正常使用,编译程序必须是标准Perl和ActivePerl。</td></tr></table><table align=center width=620><tr><td class=a14>
PDK下载地址:<a href="http://ftp.tanshuai.net/pub/"><font color="#0000FF">http://ftp.tanshuai.net/pub/</font></a> <a href="ftp://ftp.tanshuai.net/pub/"><font color="#0000FF">ftp://ftp.tanshuai.net/pub/</font></a> </td></tr></table><table align=center width=620><tr><td class=a14>
PerlApp和PerlSvc,前者是标准的应用程序,后者是Windows2000的服务程序(类似与IIS,一开机就启动的服务程序,而且无法中断它的运行)。他们有两种运作模式:依靠(Dependent)和独立(Freestanding),“依靠”模式程序运行的系统上必须有Perl解析器和相关模块,这样的程序相对较小;“独立”模式,Perl解析器等相关模块都会完全嵌入在程序之中,这样的程序在任何Windows2000操作系统上都可以顺利运行,而不需要额外的支持,但是程序相对较大。</td></tr></table><table align=center width=620><tr><td class=a14>
使用方法:</td></tr></table><table align=center width=620><tr><td class=a14>
标准使用方法(“依靠”模式):</td></tr></table><table align=center width=620><tr><td class=a14>
perlapp <脚本名></td></tr></table><table align=center width=620><tr><td class=a14>
这样程序就会创建一个以脚本名命名的可执行文件<脚本名.exe></td></tr></table><table align=center width=620><tr><td class=a14>
“独立”模式:</td></tr></table><table align=center width=620><tr><td class=a14>
perlapp(或者perlsvc) –f <程序名></td></tr></table><table align=center width=620><tr><td class=a14>
定义输出可执行文件名:</td></tr></table><table align=center width=620><tr><td class=a14>
perlapp(或者perlsvc) –e=tanshuai.exe test.pl</td></tr></table><table align=center width=620><tr><td class=a14>
它将会把test.pl文件输出的可执行文件名改为“tanshuai.exe”。</td></tr></table><table align=center width=620><tr><td class=a14>
设置程序属性:</td></tr></table><table align=center width=620><tr><td class=a14>
perlapp(或者perlsvc) -i=<类表> <程序名></td></tr><tr><td class=a14>
<table border="1" align=center width="300">
<tr>
<td>类表名</td>
<td>目标项目</td>
</tr>
<tr>
<td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -