Perl 简明教程
Perl - Introduction
Perl 是一种通用编程语言,最初为文本处理而开发,现在用于各种任务,包括系统管理、Web 开发、网络编程、GUI 开发等。
Perl is a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming, GUI development, and more.
What is Perl?
-
Perl is a stable, cross platform programming language.
-
Though Perl is not officially an acronym but few people used it as Practical Extraction and Report Language.
-
It is used for mission critical projects in the public and private sectors.
-
Perl is an Open Source software, licensed under its Artistic License, or the GNU General Public License (GPL).
-
Perl was created by Larry Wall.
-
Perl 1.0 was released to usenet’s alt.comp.sources in 1987.
-
At the time of writing this tutorial, the latest version of perl was 5.16.2.
-
Perl is listed in the Oxford English Dictionary.
PC Magazine 宣布 Perl 是其1998年技术卓越奖开发工具类别的决赛入围者。
PC Magazine announced Perl as the finalist for its 1998 Technical Excellence Award in the Development Tool category.
Perl Features
-
Perl takes the best features from other languages, such as C, awk, sed, sh, and BASIC, among others.
-
Perls database integration interface DBI supports third-party databases including Oracle, Sybase, Postgres, MySQL and others.
-
Perl works with HTML, XML, and other mark-up languages.
-
Perl supports Unicode.
-
Perl is Y2K compliant.
-
Perl supports both procedural and object-oriented programming.
-
Perl interfaces with external C/C++ libraries through XS or SWIG.
-
Perl is extensible. There are over 20,000 third party modules available from the Comprehensive Perl Archive Network (CPAN).
-
The Perl interpreter can be embedded into other systems.
Perl and the Web
-
Perl used to be the most popular web programming language due to its text manipulation capabilities and rapid development cycle.
-
Perl is widely known as "the duct-tape of the Internet".
-
Perl can handle encrypted Web data, including e-commerce transactions.
-
Perl can be embedded into web servers to speed up processing by as much as 2000%.
-
Perl’s mod_perl allows the Apache web server to embed a Perl interpreter.
-
Perl’s DBI package makes web-database integration easy.
Perl is Interpreted
Perl 是一种解释型语言,这意味着可以按原样运行代码,而无需通过创建不可移植的可执行程序的编译阶段。
Perl is an interpreted language, which means that your code can be run as is, without a compilation stage that creates a non portable executable program.
传统编译器将程序转换为机器语言。当您运行 Perl 程序时,它首先编译为字节码,然后在程序运行时转换为机器指令。因此,它与 shell 或 Tcl 并不完全相同,后者在没有中间表示的情况下以 strictly 形式进行解释。
Traditional compilers convert programs into machine language. When you run a Perl program, it’s first compiled into a byte code, which is then converted ( as the program runs) into machine instructions. So it is not quite the same as shells, or Tcl, which are strictly interpreted without an intermediate representation.
它也不像大多数 C 或 C++ 版本那样,后者直接编译为机器相关格式。它介于 Python 和 awk 以及 Emacs .elc 文件之间。
It is also not like most versions of C or C++, which are compiled directly into a machine dependent format. It is somewhere in between, along with Python and awk and Emacs .elc files.