Perl Programming   «Prev  Next»
Lesson 1

Basic Perl Programming

This course is for anyone who needs a results-oriented introduction to Perl 5.
It is designed to give you a solid background in the Perl language, covering all of its major features and functions.

Origins of Perl Programming Language

Perl was originally developed as a language to replace awk and sed in Unix system administration.
It has since become the defacto language for Internet programming as well, and today it's hard to find a system the is not using Perl for one purpose or another. Perl is a scripting language which means that it runs directly from the source code. There is no separate compilation process. But, it is not a strictly interpreted language either.
The program perl actually compiles much of the source code into an intermediate byte code which is then optimized before running. The effect is a language with many of the advantages of both interpreters and compilers.
With its flexible syntax, rich regular expressions and full library of internal functions, Perl has allowed me to open up my creativity as a programmer. I hope it does the same for you.

Perl History

Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions. Perl 6, which began as a redesign of Perl 5 in 2000, eventually evolved into a separate language and both languages continue to be developed independently by different development teams.
The Perl languages borrow features from other programming languages including
  1. C,
  2. shell script (sh),
  3. AWK, and
  4. sed.
They provide powerful text processing facilities without the arbitrary data-length limits of many contemporary Unix commandline tools, facilitating easy manipulation of text files. Perl 5 gained widespread popularity in the late 1990s as a CGI scripting language, in part due to its regular expression and string parsing capabilities.

Perl Course goals

By working through the course lessons and exercises, you will gain the skills you need to:
  1. Write effective Perl programs for common system-administration tasks
  2. Take advantage of regular expressions--even in other languages
  3. Understand, use, and modify Perl programs written by other people
  4. Create quick, one-liner programs for simple everyday tasks
  5. Move on to the next course in the Programming in Perl Series, Perl for the Web.

Before we begin

Before we actually start, take a few minutes to go over the following:
  1. Course Perl Prerequisites
  2. Course Course Structure Learning Perl
  3. What you will need for this course

Perl was originally thought of as a natural enhancement for the popular csh shell script notation of Unix, Perl was at first primarily used for text manipulation. Its maturity in the early 1990s coincided with the rise of the Web, and it rapidly became the most popular programming language for HTML form processing and otherWeb development as well.
Perl has been called a "Swiss Army" knife for its features coupled with its considerable programming power and flexibility. The common phrase among hardened Perl programmers is: "There is more than one way to do it." Most programming goals can be achieved in Perl in at least three ways, depending on which language features and techniques the programmer prefers to use. It is not uncommon for an experienced Perl programmer to reach for the manual when reading code written by another programmer. Perl has also been called "duct tape for the Web", emphasizing its utility for producing applications, Web sites, and general program fixes for a wide variety of problems and domains.
In this module we give a brief history of Perl, including major events preceding the creation of Perl that set the historical stage for it. We provide an overview of the language, including example code to show how its features are used in practice. We discuss Web site programming in Perl using the CGI (Common Gateway Interface) standard and show several database interface methods in Perl.
In the next lesson, some of the features of the Perl Programming Language will be covered.
Then, the following two lessons will walk you through the steps of downloading perl and installing it on your machine.

Advanced Perl Programming