源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

什么是Perl?编程语言Perl详细介绍

  • 时间:2022-05-13 12:26 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:什么是Perl?编程语言Perl详细介绍
Perl 最初的设计者为拉里·沃尔(Larry Wall),它于1987年12月18日发表。Perl借取了C、sed、awk、shell scripting以及很多其他程序语言的特性。Larry Wall在新闻组comp.sources.misc发布了Perl脚本语言1.0版,当时他是Unisys公司的一名程序员。Perl借鉴了sh、Awk和Sed等脚本语言的特性,试图成为一个能简化报告处理的通用 Unix脚本语言。 Perl 2在1988年发布,增加了更多特性,拥有更好的正则表达式引擎。Perl 3和 Perl 4分别在1989年和1991年发布,而1994年发布的 Perl 5则是最重要的一个版本,至今仍在开发中。2000年启动的Perl 6则完全重写了Perl,基于不同的原则,开发者决定先制定语言规格。Perl 6的发布日期被认为是圣诞节,但没有指定哪一年的圣诞节。Perl 5公布了16个版本,Perl 5.6在2000年发布,Perl 5.8的持续开发贯穿了2002-08年,5.10在2007年发布,5.12在2010年发布,此后  Perl开始采用每月发布一个版本每年发布一个稳定版本的发布周期,5.14在2011年发布,5.16于2012年发布。 Perl 一般被称为“实用报表提取语言”(PracticalExtraction andReportLanguage),虽然有时被称做“病态折中垃圾列表器”(PathologicallyEclectic Rubbish Lister)。它是术语,而不仅仅是简写,Perl的创造者,LarryWall提出第一个,但很快又扩展到第二个。那就是为什么“Perl”没有所有 字母都大写。没必要争论那一个正确,Larry 两个都认可。你也可能看到“perl”,所有的字母都是小写的。一般,“Perl”,有大写的 P,是指语言本身,而“perl”,小写的 p,是指程序运行的解释器。Perl的正式网站是 lwall@jpl-dexxav.JPL.NASA.GOV(Larry Wall) Newsgroups: news.groups,rec.arts.poems,comp.lang.perl Subject: CALL FOR DISCUSSION: comp.lang.perl.poems Message-ID: Date: 1 Apr 90 00:00:00 GMT Reply-To: lwall@jpl-devvax.JPL.NSAS.GOV(Larry Wall) Organization: Jet Prepulsion Laboratory, Pasadena, CA Lines: 61 It has come to my attention that there is a crying need for a place for people to express both their emotional and technical natures simultaneously. Several people have sent me some items which don't fit into any newsgroup. Perhaps it's because I recently posted to both comp.lang.perl and to rec.arts.poems, but people seem to be writing poems in Perl, and they're asking me where they should post them. Here is a sampling: From a graduate student (in finals week), the following haiku: study, write, study, do review (each word) if time. close book. sleep? what's that? And someone writing from Fort Lauderdale writes: sleep, close together, sort of sin each spring & wait; 50% die A person who wishes to remain anonymous wrote the following example of "Black Perl".  (The Pearl poet would have been shocked, no doubt.) BEFOREHAND: close door, each window & exit;  wait until time. open spellbook, study, read (scan, select, tell us); write it, print the hex while each watches, reverse its length, write again; kill spiders, pop them, chop, split, kill them. unlink arms, shift, wait & listen (listening, wait), sort the flock (then, warn the "goats" & kill the "sheep"); kill them, dump qualms, shift moralities, values aside, each one; die sheep! die to reverse the system you accept (reject, respect); next step, kill the next sacrifice, each sacrifice, wait, redo ritual until "all the spirits are pleased"; do it ("as they say"). do it(*everyone***must***participate***in***forbidden**s*e*x*). return last victim; package body; exit crypt (time, times & "half a time") & close it, select (quickly) & warn your next victim; AFTERWORDS: tell nobody. wait, wait until time; wait until next year, next decade; sleep, sleep, die yourself, die at last I tried that, and it actually parses in Perl.  It doesn't appear to do anything useful, however.  I think I'm glad, actually... I hereby propose the creation of comp.lang.perl.poems as a place for such items, so we don't clutter the perl or poems newsgroups with things that may be of interest to neither.  Or, alternately, we should create rec.arts.poems.perl for items such as those above which merely parse, and don't do anything useful.  (There is precedent in rec.arts.poems, after all.)  Then also create comp.lang.perl.poems for poems that actually do something, such as this haiku of my own: print STDOUT q Just another Perl hacker, unless $spring Larry Wall            lwall@jpl-devvax.jpl.nasa.gov
古老的 Perl 永远也不停止创新的步伐,7月18日,Perl 5.8.0 发布了。 5.8.0 的亮点主要有: - 更好的 Unicode 支持: 自从 5.6 版以来, Unicode 支持已在各层面上大幅更新: - 支持 Unicode 3.2.0 版 (Perl 5.6.1 支持 3.0.1 版) - 在语言及内部层次上, 提供更普遍而平滑的 Unicode 环境 - 正则表示式能够配合Unicode 了 - 提供 Encode 模块, 以支持现存的编码方式 (包括各种中/日/韩系统) - 多线程执行模式: 「解释器多线程法」(interpreter threads, 简称「ithreads」) 是新的多线程执行模式。我们强烈建议您用它来取代旧版的「5.005 多线程法」模式. 两者间主要的差异, 在于 ithreads 下必需明确宣告要共享的资料. - 新的输入/输出模式: 新推出的 PerlIO 模式, 同时提供了源码层级的跨平台stdio 实作, 以及更丰富的输出入控制架构. - 更精确的数值: 之前的 Perl 版本依赖于您系统上的字串/数值转换函数; 这往往造成了跨平台的障碍, 以及错误的计算结果. - 64 比特支持: 目前的 64 比特支持已经成熟 -- 若您的系统支持 64 比特的整数或地址空间,就可以在编译时指定使用这些功能. - 安全的信号 (signal) 处理: 之前的版本里, Perl 在接收信号时可能会破坏解释器的内部状态. - 大量的新模块: Digest::MD5, File::Temp, Filter::Simple, libnet, List::Util,Memoize, MIME::Base64, Scalar::Util, Storable, Switch,Test::More, Test::Simple, Text::Balanced, Tie::File, ... - 彻底的兼容性测试: Perl 现在具备了六倍于 5.6 版的测试套件, 并且每日在各种平台上进行装设测试. [兼容性] - 二进制档案不兼容: 主要由于 PerlIO 的导入, Perl 5.8 与先前的 Perl 版本之间并无「二进制兼容性」. 您可能会需要再次编译各个 XS 延伸模块. - AIX 动态载入: 为了与 AIX 系统上的其他程序更加兼容, Perl 在 AIX 系统上启用了系统的动态载入, 而非早先的模拟方式. - 停用 64 比特平台上的 Perl Malloc 内存配置: Perl 的 malloc 函数在 64 比特定址的机器上似乎有许多问题. 因此, 我们现在预设使用系统原生的 malloc 函数. - 散列顺序又改变了: Perl 内部的散列函数又改成了较好的版本, 不过只要您的源码不依赖于特定的散列键顺序, 这就不成问题. - my 的属性改在执行阶段处理: my() 变数的属性目前改在执行阶段处理, 而非编译阶段. - REF(...) 取代了 SCALAR(...): 为符合 ref() 的结果, 对参照 (reference) 的参照在字串里改以 "REF(...)"表示. - 更新的 Unicode 处理模式, 大幅减少了需要使用 "use utf8" 之处:在 Perl 5.6 版时, 资料是否视为 Unicode, 端视其运算是否处于 "use utf8",编译命令的有效范围内而定; 现在, Perl 5.8 直接将 "Unicode 性质" 连结到资料上. 因此, 目前只有在程序码内用到 UTF-8 字面值 (literal) 时, 才需使用 "use utf8". (在没有 "use utf8" 时, 为了保持与现存命令稿的兼容性,字面值仍视为字节处理.) - VMS: Socket 延伸模块动态化, Alpha 预设使用 IEEE 浮点数 - Socket 延伸模块在 VMS 平台上改为动态载入; 这在极旧版的 VMS 上可能会造成问题. - OpenVMS Alpha目前预设使用 IEEE 浮点数格式. 这样做的理由及细节, 请见README.vms. [用词改变] - 《骆驼书》(Programming Perl, 《Perl 程序设计》) 第三版内的「IO 规则」(IO discipline), 现在改称为「IO 层」(IO layer). [不建议使用] - dump(): dump 指令的功能, 目前视同作废. - 5.005 多线程法模式已不建议使用 请采用新的「解释器多线程法」模式. - 虚拟散列 (Pseudohash): 使用者层级的虚拟散列语法将被移除, 改成比较简洁的操作界面. 此外, 内部的实作方式也必须更改, 因为它减缓了一般散列的存取速度. - "exec(串列)" 与 "system(串列)" 参数内的受污染 (tainted) 资料: 目前这会触发警告讯息, 但在未来的版本里会变成致命错误. - tr///C, tr///U: 这两个操作界面是个意外; 请采用 pack("C0", ...) 及 pack("U0", ...). [已知问题] - AmigaOS 无法装设 Perl 5.8.0. - 编译套件: 比特码编译及原生码编译仍然有问题. - Lvalue 左值函数仍然视为实验性质. - local() 与 tie() 的交互使用结果, 仍未清楚定义. - 系结(Tied) 或魔法(Magical) 阵列及散列并不会自动生成 (Autovivify). - 自我系结的阵列及散列, 目前禁用. --- 再次提醒您, 请详阅 pod/perldelta.pod, INSTALL, 以及 README.平台。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部