Hour 1. Getting Started with Perl

Perl is a general-purpose programming language. It can be used for anything that any other programming language can be used for. It has been used in every industry imaginable for almost any task you can think of. It's used on the stock market, in manufacturing, design, customer support, quality control, Y2K testing, systems programming, payroll, inventory, and, of course, on the Web.

Perl is used in so many places because Perl is what's known as a glue language. A glue language is used to bind things together. You probably wouldn't want to write a word processor in Perl—although you could—because good word processors are already available. Writing a database, a spreadsheet, an operating system, or a full-featured Web server in Perl would be silly—but again, possible.

But what Perl is good at is tying these elements together. Perl can take your database, convert it into a spreadsheet-ready file, and during the processing, fix the data if you want. Perl can also take your word processing documents and convert them to HTML for display on the Web.

As a side effect of being a language designed to glue elements together, Perl is very adaptable. It runs under, at last count, about two dozen operating systems—and probably more. Perl's programming style is very flexible, so you can do the same things in many ways. Your Perl programs may look nothing like mine, but if they both work, that's okay. Perl can be a strict language when it needs to be, and it can be forgiving to new programmers if you want. It's all up to you.

Let me just clear up a few points. The name of the programming language is Perl. The name of the program that runs your programs, the interpreter, is perl. The distinction usually isn't very important to you—except when you're trying to start your programs; then it's always perl. Sometimes—but not here—you will see Perl written as PERL. This use is probably based on the fact that one explanation of Perl's name came from the acronym Practical Extraction and Report Language. Nobody really calls it PERL anymore; it's too pretentious. It's just Perl to its friends.

Note

Many of Perl's features were "borrowed" from other languages. This borrowing gave rise early on to Perl's other acronym-expansion: Pathologically Eclectic Rubbish Lister.


In this hour we'll cover

  • Installing Perl

  • Accessing Perl's internal documentation

  • Writing your first Perl script

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.16.23