Perl - Introduction

Perl is a family of script programming languages that are similar in syntax to the C language, including Perl 5 and Perl 6. Perl is an open source, general-use, interpreted language.

In general, Perl is easier to learn and faster to code in than the more structured C and C++ languages. Perl programs can, however, be quite sophisticated. It is often used for developing common gateway interface (CGI) programs because it has good text manipulation facilities, although it also handles binary files.

Perl includes a number of popular UNIX facilities such as sed, awk, and tr. It can be compiled just before execution into either C code or cross-platform bytecode. When compiled, a Perl program is almost as fast as a fully precompiled C language program. A plug-in can be installed for some servers, such as Apache, so that Perl is loaded permanently in memory, thus reducing compile time and resulting in faster execution of CGI Perl scripts.

What is Perl?

Perl stands in for "Practical Extraction and Reporting Language" even though there is no authorized acronym for Perl. You may create your own acronym, and no one will mind. Perl was created by Larry Wall in 1987 when he was employed on a bug reporting system and "AWK"- a programming language he was using for the purpose was not helping him much. He is still the chief architect and developer of Perl. If we want to define Perl in one sentence: Perl is a high-level, interpreted, dynamic programming language. Did it all sound Greek to you? (Unless you actually know Greek).

Perl is a programming language specially designed for text editing. It is now widely used for a variety of purposes including Linux system administration, network programming, web development, etc.

Let's put it in a simple manner. While computers understand just 0's and 1's (binary language/machine language/ [low-level language]), it is very difficult to program in a binary language for us human. Perl is a programming language which uses natural language elements, words that are used in common English language and is, therefore, easier to understand by humans [high-level language]. Now there's a problem; computers cannot understand high-level languages, which we humans can easily understand. For that, we need something which can translate the high-level language to low-level language. Here interpreter comes to our help. The interpreter is a piece of software which converts the program written in the high-level language to low-level language for the computer to understand and execute the instructions written in the program. Hence, Perl is an interpreted programming language.

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

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.

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.

Perl Archive Network

Visit our Perl Archive Network

Perl functions

Visit Perl functions

Perl examples

Visit Perl examples

© copyright localhost is operated by International Freedom