PERL


Perl is a powerful interpreted scripting language which was originally designed as a text handling, processing and formatting language.

Unlike an application in a compiled language such as C or C++, which is compiled into a binary executable file and then run. An interpreted language such as Perl, is parsed and executed at runtime. It should be noted however, that Perl being Perl, it has an interesting approach even to this, in that Perl first compiles the code into an intermediate form, and gives rapid feedback on any errors, then it sends the intermediate code to the interpreter. This whole process takes place in mere seconds (or less), so is largely transparent to the user.

The advantage of the interpreted approach used by Perl, is that it is faster to develop, test and debug code, since the code does not have to be compiled each time it is run. The disadvantage is that an interpeted language such as Perl will generally always run more slowly than a compiled language such as C or C++.

Perl stands for Practical Extraction and Reporting Language, and was first created in 1987 by Larry Wall. The language has evolved from its text processing origins to include techniques such as object orientated programming, socket programming, CGI programming, interfacing to serial ports, and interfacing to graphics libraries and modules. Perl is frequently referred to as the Internet's duct tape, due to the large number of CGI applications that are written using Perl. It is the most commonly used scripting language for CGI applications, and has a host of add-on modules which speed up development. It is not particularly intuitive however, and whereas most langauges offer 1 way to perform a task, Perl will often offer several - this can be a drawback since it can be confusing.

Perl is an open source language, freely available for download and use, and released under the Artistic license. The current version of Perl is Perl 5. Perl 5.000 was first released at the end of 1994, and the latest release of Perl as of July 2002, is Perl 5.8 (the latest development version of Perl is Perl 5.9), although some may be more comfortable with the increased stability of Perl 5.6.

The current latest stable and development vesions of Perl can be found at:

http://www.perl.com/pub/language/info/software.html#stable

Perl Pluses.

Perl Minuses.

Perl Portability

Very portable. Runs on all flavours of Unix and Linux, as well as Windows 95/98 and Windows NT and Windows 2000.

Perl points for IT managers to note.

Perl code examples

1. Simple Perl internet email program
- This example demonstrates a simple perl program to send email across the internet using the sendmail application.

2. Displaying environment variables using Perl
- This example demonstrates a simple perl program using the Common Gateway Interface (CGI) to display environment variables on a web browser.

3. Displaying a web server error log using Perl
- This example demonstrates how Perl can be used to display a browser based web server error log.

4. Converting the epoch date format
- This example demonstrates how Perl can be used to convert the epoch date format to a more conventional date/time format.

5. Obfuscated Perl
- An example of obfuscated Perl, an exercise in programming minimalism.

6. Database query using Perl
- This example demonstrates how Perl can be used with SQL to retrieve a value from a database.

7. Useful Perl code fragments #1
- A number of code fragments are included that can be readily inserted into Perl programs.

8. Useful Perl code fragments #2
- Additional code fragments that can be readily inserted into Perl programs.

9. Perl Regular Expression Example
- An example of how a few lines of Perl can extract specific data from a mixed alphanumeric string.



www.cyberthinc.com