Perl Programming/About Perl

From Wikibooks, open books for an open world
Jump to navigation Jump to search
  Index Next: Getting started

Perl is a programming language designed by Larry Wall, known today for its strong community and module archive CPAN. It was originally developed to process text and produce reports. As a result, a backronym has been formed from its name: Practical Extraction and Report Language. It makes extensive use of significant punctuation, and highly chaotic-looking code has been written in it. This has resulted in a less complimentary backronym (which is still embraced by Perl users): Pathologically Eclectic Rubbish Lister (said to be a quote from the language designer himself).

Perl is Free Software, available under the Artistic License and the GPL. It was developed on Unix, and its Unix roots are pervasive. Perl is available for most operating systems but is particularly prevalent on Unix and Unix-like systems, and is growing in popularity on Microsoft Windows systems. However, it has been ported to a multitude of environments (some say as many as Java). It's a popular systems administration tool in Windows. Most of the things done in Perl transfer well from one operating system to another (provided suggested conventions are followed).

As an example of Perl in action, until January 2002 the software running Wikipedia was a CGI script written in Perl (Usemod programmed by Clifford Adams; still available at http://usemod.com).

Another example is Slashdot, which runs on the Perl-based Slashcode software.

When used on the web, Perl is often used in conjunction with the Apache web server and its mod_perl module. This embeds the Perl binary into the webserver so the CGI script need not fire up a new copy each time it's accessed. Other features such as database connection persistence greatly reduce the access times to the page.

History[edit | edit source]

The Perl programming language was created by Larry Wall in 1987. It borrows features from C, sed, awk, shell scripting (sh), and (to a lesser extent) from many other programming languages as well. The name is normally capitalized ("Perl") when referring to the language, but not capitalized ("perl") when referring to the interpreter (e.g. "Only perl properly parses Perl.")

Rationale[edit | edit source]

Perl was designed to be a practical language to extract information from text files and generate reports. One of its mottos is There is more than one way to do it (TIMTOWTDI - pronounced 'Tim Toady'). Another is Perl: the Swiss Army Chainsaw of Programming Languages. One stated design goal is to make easy tasks easy and difficult tasks possible. Its versatility permits versions of many programming paradigms: procedural, functional, and object-oriented — though purists object to Perl's as it is not a cleanly designed language. Perl has a powerful regular expression support built in directly to the syntax. Perl is often considered the archetypal scripting language and has been called the "glue that holds the web together", as it is one of the most popular CGI languages. Its function as a "glue language" can be described broadly as its ability to tie together different systems and data structures that were not designed to be tied together.


  Index Next: Getting started