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.
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
- C,
- shell script (sh),
- AWK, and
- 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.
Before we actually start, take a few minutes to go over the following:
Perl Course Prerequisites
Since Perl is based on awk
, sed
, sh
, and C, if you know one or more of those languages,
you may be in a position to learn Perl faster, but it's not really necessary that you know them.
If your programming experience is limited, you might havfe to take a little more time with each lesson.
Because Perl was written for Unix (and has been ported to other operating systems), some knowledge of Unix is also helpful, but not necessary.
Again, if you have no Unix experience, some of the concepts may be foreign to you, but they should not be insurmountably so.
AWK
Several kinds of tasks occur repeatedly when working with text files. You might want to extract certain lines and discard the rest. Or you may need to make changes wherever certain patterns appear, but leave the rest of the file alone. Such jobs are often easy with awk. The awk utility interprets a special-purpose programming language that makes it easy to handle simple data-reformatting jobs.
The GNU implementation of awk is called gawk; if you invoke it with the proper options or environment variables, it is fully compatible with the POSIX[1] specification of the awk language and with the Unix version of awk maintained by Brian Kernighan. This means that all properly written awk programs should work with gawk. So most of the time, we do not distinguish between gawk and other awk implementations.
Using awk you can:
- Manage small, personal databases
- Generate reports
- Validate data
- Produce indexes and perform other document-preparation tasks
- Experiment with algorithms that you can adapt later to other computer languages
In addition, gawk provides facilities that make it easy to:
- Extract bits and pieces of data for processing
- Sort data
- Perform simple network communications
- Profile and debug awk programs
- Extend the language with functions written in C or C++
Platform Support
This course is platform-independent and can be taken on any Win32, Mac, or Unix system. Platform-dependent instructions are provided throughout the course. Perl Scripts can be developed on a Win32 platform and the best environment on which to run your Perl Scripts is a Linux/Unix environment.
- Course Course Structure Learning Perl
- 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.