Perl: Practical Extraction and Report Language,现在的说法,但开始不是这样的。是由Larry Wall 在1987年12月18日发行了第一版。

现在最常见是第五版。 通常大部分UNIX/LINUX都预置了不同版本的Perl,有些特殊的软件如Apache/Oracle也预置了。

Perl目前的官方网站http://www.perl.org/

clip_image002

Perl的发布通常分成两种一种是Binary形式,主要是由Activestate公司提供http://www.activestate.com/activeperl/downloads

通常在Windows上都是选择Binary包ActivePerl。另一种形式是sourcecode形式,特别是在linux版本上,可以采用如下方法:

isdlins(root)>#wget http://www.cpan.org/src/5.0/perl-5.14.1.tar.gz

isdlins(root)>#tar -xzf perl-5.14.1.tar.gz

isdlins(root)>#cd perl-5.14.1

isdlins(root)>#./Configure -des -Dprefix=$HOME/localperl

isdlins(root)>#make

isdlins(root)>#make test

isdlins(root)>#make install

查看当前安装的Perl版本,在linux/Unix可用如下命令查看:

[root@windriver-machine pne4.0]# perl -version

This is perl, v5.8.8 built for i386-linux-thread-multi

Copyright 1987-2006, Larry Wall

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 source kit.

Complete documentation for Perl, including FAQ lists, should be found on

this system using "man perl" or "perldoc perl". If you have access to the

Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[root@windriver-machine pne4.0]#

Perl运行非常广泛,特别是系统管理上,Perl功能非常强大,强大的让你几乎难以置信。按照官方描述,这里将Perl 功能分为如下几大类:

  • 脚本语言,解释执行,不需要经过编译链接环节,可以直接运行显示结果
  • 具有编译语言如C,JAVA复杂的功能,同时又有SHELL脚本的方便。适用于对速度、内存要求不高的应用任务。
  • 强大的字符串处理功能,支持复杂灵活的正则表达式。
  • 目前大多数平台内含支持,并且是免费的

Perl通常都使用一些基本的文本编辑工具进行开发,Eclipse也有perl的插件,但最多的还是VI。

首行 #!/usr/bin/perl,在windows平台不一定要求严格对应指定的perl执行路径,但最后字符串一定是perl。

clip_image004