Aumpage Network > Internet > Perl

Perl

Perl (Practical Extraction and Report Language)

Perl

Perl, also Practical Extraction and Report Language (a backronym, see below), is a programming language released by Larry Wall on December 18, 1987 that borrows features from C, sed, awk, shell scripting (sh), and (to a lesser extent) from many other programming languages.

Perl has been ported to over a hundred different platforms, and the mission of making the language available everywhere is commemorated in the name of the main newsgroup for discussion of issues relating to perl development, "perl5-porters". Perl is widely used in web development, finance and bioinformatics, and indeed in most sectors where a premium is placed on rapid development and the availability of a large number of standard and 3rd-party modules. Because of its wide availability, Perl, like Java, is often considered to be a platform in its own right, packaging a Unix-like environment in which software can be written once, and generally run without modifications almost everywhere. In addition to its numerous binary ports, Perl can, with only 6 reported exceptions, be compiled from source on all Unix-like, POSIX-compliant or otherwise Unix-compatible platforms, including AmigaOS, BeOS, Cygwin, and Mac OS X. Custom binary ports are available for Windows (ActivePerl) and Mac OS Classic((Extern link: http://www.perl.com/CPAN/ports/)


Perl was designed to be a practical language to extract information from text files and to generate reports from that information. One of its mottos is "There's more than one way to do it" (TMTOWTDI - usually pronounced 'Tim Toady', but keeping in line with the motto, there's more than one way to do it). 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 some claim that Perl is not a cleanly designed language because of its multiple paradigms). Perl has a powerful regular expression engine built directly into its 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 interfaces that were not designed to interoperate.


Perl is one of the programming language components of the popular LAMP free software platform for web development.


Perl is free software, available under a combination of the Artistic License and the GPL. It is available for most operating systems but is particularly prevalent on Unix and Unix-like systems (such as Linux, FreeBSD, and Mac OS X), and is growing in popularity on Microsoft Windows systems. As an example of Perl in action, Wikipedia itself was a CGI script written in Perl until January 2002. 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.


Perl is regarded by both its proponents and detractors as something of a grab bag of features and syntax. The difference between the two camps lies in whether this is seen as a virtue or a vice. Perl votaries maintain that this varied heritage is what makes the language so useful. Reference is often made to natural languages such as English and to evolution. For example, Larry Wall has argued that:


... we often joke that a camel is a horse designed by a committee, but if you think about it, the camel is pretty well adapted for life in the desert. The camel has evolved to be relatively self-sufficient. On the other hand, the camel has not evolved to smell good. Neither has Perl.


In recognition of its ugly-but-useful nature, Perl has adopted the camel as its mascot; and the O'Reilly manual on Perl, Programming Perl, is known as the camel book: so named because of the camel that graces its cover.


A huge collection of freely usable perl modules, ranging from advanced mathematics to database connectivity, networking and more, can be downloaded from a network of sites called CPAN, an acronym for Comprehensive Perl Archive Network. Most or all of the software on CPAN is also available under either the Artistic License, the GPL, or both. As of January 1, 2005, CPAN includes more than 7,000 modules, contributed by nearly 4,000 authors.


A major advantage of Perl for those who work with large quantities of data is that it is highly scalable, as it does not place arbitrary limits on the sizes of its built in data structures. Resources permitting, a Perl program can read an entire multi-gigabyte file into RAM. This flexibility in the face of bulky data dumps has made Perl popular among bioinformatics researchers, who routinely read substantial fractions of the human genomic sequence into Perl data structures.


CPAN.pm is also the name of the Perl module that downloads and installs other Perl modules from one of the CPAN mirror sites: such installations can be done with interactive prompts, or can be fully automated.


Although Perl has most of the ease-of-use features of an interpreted language, it does not strictly interpret and execute source code one line at a time. Rather, perl (the program) first compiles an entire program into an internal form (a parse tree) which is then optimized before being run. Perl's formal grammar is interesting in that it is context-free but cannot be parsed by a Yacc generated parser. This produces a number of differences from traditional interpreters. Any syntax errors are caught during the compile stage instead of later during execution. Subroutine calls can be placed in the file before the subroutines themselves are defined. And long-running programs are rather fast and efficient compared to strictly-interpreted languages, at the expense of short programs suffering the overhead of the compile-optimize stage. Since version 5.005 it has been possible to compile a Perl program to byte code to save the compilation stage on later executions, though the "interpreter" is still needed to execute that code. This could be seen as a precursor to Parrot.


Perl has three built-in data types: scalars, arrays, and hashes. A scalar holds a single value, such as a string, number, or reference. Arrays are ordered lists of scalars indexed by number starting at 0. Hashes, or associative arrays, are unordered collections of scalar values indexed by their associated key.


Scalars, arrays, and hashes can be assigned to named variables. The first character of the variable name identifies the type of data held within the variable. The remaining part identifies the particular value the variable refers to.


Names of scalar values always begin with '$', regardless of whether the variable referred to belongs to an array or hash



The text above is licensed under the GNU Free Documentation License (GNU FDL).
It uses material from the Wikipedia article "Perl".

There are 6 relevant articles:

XHTML  PHP  Perl  website  World Wide Web  hypertext  

There are 1 relevant news articles:

13 Relevant book recommendations:

Search for Perl at


Aumpage Network - In english
Earn money with your website
Books about Perl
Advanced Perl Programming
Advanced Perl Programming by Sriram Srinivasan

More info
Computer Viruses For Dummies
Computer Viruses For Dummies by Peter H. Gregory

More info
Effective XML: 50 Specific Ways to Improve Your XML
Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold

More info
Google Hacks
Google Hacks by Tara Calishain, Rael Dornfest

More info
Google Hacks: 100 Industrial-Strength Tips & Tools
Google Hacks: 100 Industrial-Strength Tips & Tools by Tara Calishain, Rael Dornfest

More info
Java Kochbuch
Java Kochbuch by Ian F. Darwin

More info
Learning Perl, Third Edition
Learning Perl, Third Edition by Randal L. Schwartz, Tom Phoenix

More info
Learning XML, Second Edition
Learning XML, Second Edition by Erik T. Ray

More info
MySQL Cookbook
MySQL Cookbook by Paul DuBois

More info
Perl Cookbook
Perl Cookbook by Tom Christiansen, Nathan Torkington

More info
Programmieren mit Perl
Programmieren mit Perl by Larry Wall, Tom Christiansen, Jon Orwant, Randal Schwartz

More info
Programming Perl
Programming Perl by Larry Wall, Tom Christiansen, Jon Orwant

More info