Perl: A Beginner's Guide

Perl: A Beginner's Guide

Perl: A Beginner's Guide

Perl: A Beginner's Guide

Paperback

$37.00 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores

Related collections and offers


Overview

Essential skills for first-time programmers! Perl: A Beginner's Guide will teach you the fundamentals of Perl programming. It covers Perl capabilities and syntax, accessing databases, working with modules, CGI programming, debugging and much more. This beginner's guide is designed for easy learning: Modules: Each programming concept is divided into logical modules (chapters), ideal for linear learningGoals: Each module opens with the specific programming skills you'll have by the end of the moduleAsk the Experts: Q&A sections throughout1-Minute Drills: Quick self-assessment sections to check your progressAnnotated Syntax: Example code annotated with commentary that points to the particular technique illustratedProjects: Coding exercises contained in each module that build on one another, from simple to complexMastery Checks: End-of-module reviews that test proficiency using multiple-choice, fill-in-the-blank, and simple coding questions

Product Details

ISBN-13: 9780072129571
Publisher: McGraw-Hill Companies, The
Publication date: 01/01/2000
Series: Beginner's Guides (Osborne)
Pages: 474
Product dimensions: 7.50(w) x 9.25(h) x 1.01(d)

Read an Excerpt

Module 1: Introduction to Perl

Welcome to Perl: A Beginner's Guide. Your purchase of this book shows your desire and dedication to learn one of the most widely used programming languages around today. Long before Java or JavaScript invaded the Internet and surrounding scenes, and even before the Web was born, Perl had a strong hold in its community. From automating UNIX administration tasks, to performing the routine parsing of files, Perl has been used as a true utility language.

Note: For the purpose of Perl, when UNIX is referred to, the reference is generic, to all flavors, including UNIX-compatible operating systems such as Linux. If the system has a noticeable difference that needs to be pointed out, then this is done.

Today, Perl, which means Practical Extraction and Reporting Language, is used in many new and creative ways, in addition to the good old reasons. Common Gateway Interface (CGI), file processing, Microsoft Windows scripting, graphical user interfaces (GUI), database access, you name it-Perl can do it. And, in addition to being a versatile and useful language, Perl is relatively easy to learn.

Note: When we speak of the Windows platform here, we are referring to the Windows 95, Windows 98, Windows Millennium edition (Me), Windows NT, and Windows 2000 editions (this is abbreviated 95/98/Me/NT/2000). If you want to run Perl on the Windows 3.x platform, then you must run a version that is compatible with MS-DOS.

True, some complex angles exist to Perl and some concepts may be difficult to understand, but you can ease into those. The purpose of this book is to start you onthe path toward becoming an accomplished Perl programmer, not to scare you off with hard-to-understand terminology and "system talk." Do note, though, that becoming a Perl programmer is more than just scripting some code-it is a perspective on how to solve everyday problems, tackle cumbersome issues, and live the good life with an easy, yet powerful, programming language.

So enough talk, let's get started! In this first module, you learn a bit of background and the foundation for the experience you will gather while you read this book. You learn some history on the language and some good programming techniques. You even start and complete your first Perl script! The objective is simple: to introduce you to the language in an easy to understand, and nonthreatening manner.

Note Perl programs are commonly called scripts, so the terms "programs" and "scripts" are used interchangeably in this book. Treat them as the same.

The History

As mentioned in the opening paragraphs, Perl is one of the older programming languages when it comes to those commonly discussed for Web uses. Its origin dates back to 1987 and, since then, Perl has seen four more major versions, and one semimajor release. Today, Perl boasts one of the largest groups of programmers and you find the loyalty within the tight group of users matches that of Linux, OS/2, and the Mac OS.

Because of its rich history, you should know some Perl background. So, in this first section of the book, you learn about the early days of Perl, and then move into version 4, next learn about the advances version 5 added, and then learn about the latest and greatest version of the language: Perl 5.6.

The Beginning

Larry Wall, the author of the language, first released Perl to the usenet group comp.sources on October 18, 1987. This new language, which was distributed free of charge by Mr. Wall, was derived from the C programming language and was further influenced by languages such as BASIC, awk, sed, and the UNIX shell. Perl took the best of all these worlds and wrapped them into a single, functional language.

People, with little or no programming experience, were able to pick it up quickly and start programming with Perl. In addition to its ease of learning, Perl was simply a useful language. From the beginning, Perl had an unbelievable capability to manipulate text, files, and system processes. This free, easy, and useful approach allowed the Perl language to catch on quickly.

Today, Perl is maintained by a core group of volunteers (the "Perl Porters") and programmers around the world. Like Linux, Mozilla, sendmail, or any other open source effort, Perl has tapped the world as its development team, and leverages the knowledge of many to provide us with the best possible language for our work.

Up to Perl 4

After Perl 1.0 came Perl 2.0, which was released on June 5, 1988. By this time, the number of Perl programmers had grown, as did the use of the language. Many different types of programmers were using Perl for everyday tasks and individuals within major corporations started promoting the language.

A year and a half passed before the world saw Perl 3.0, which was released October 18, 1989, some two years after 1.0 hit the wire. With this release, Perl was first distributed under the GNU General Public License (GPL) version 1.0, which allows for the distribution of free software. By this time Perl had taken off.

Thousands of programmers were using it and the Web, which was in its infant stage, really gave Perl a boost. Perl had been widely used by UNIX administrators, but was quickly becoming the standard for writing CGI scripts for processing form data sent on the Internet. CGI is covered in Module 10, so it won't be discussed in detail here but, do note, it was a significant module in the history of Perl.

Then, in March of 1991, Perl 4.0 was released under the GPL as well as the new Perl Artistic License. This is the version of the language with which many Perl programmers started. Perl was now a fairly mature language that had a robust set of functionality, although it did suffer from some performance problems.

Tip: For more information on the GNU Licenses see their Web site at http://www.gnu.org. There you can read information on the GNU GPL.

Perl 4 was the last version seen for three-and-a-half years as the language underwent a complete rewrite. This doesn't mean progress wasn't made during those years, though-in fact, this was the time Perl began to reach out and be noticed.

In January 1992 Matthias Neeracher released the first version of Perl for the Macintosh (MacPerI 4.0.2). By the end of the year, MacPerl was up to version 4.0.5, which included support for Data Base Management (DBM) and sockets. 1993 saw continued work on MacPerl, and the final version of the core Perl 4 language, Perl 4.036. The final version of MacPerl, 4.1.8, which implemented Perl 4.036, soon followed.

Introducing Perl 5

By this time, the Perl community was ready for a new version of the language. Ports were popping up all over the place, database access was available, and additional prebuilt scripts were abundant. However, it was time for a new version of the language.

In October 1994 Perl 5 was released. This version had many enhancements and took the language to the next level. Perl 5 was the first release that pushed this once-simple scripting language beyond simple administrative tasks and into a more powerful spotlight. Here are some of the enhancements that were added:

  • Complete rewrite of the interpreter to increase speed, efficiency, and functionality.

  • Support for modules, which lets programmers develop their own "libraries" that could be included into scripts by others.

  • Object-oriented features, which allowed for the construction of true objects, and paved the way for concepts such as inheritance, encapsulation, and polymorphism (don't worry if these terms scare you; they are discussed more in Module 13).

  • Increased diagnostics and warnings generated for coding techniques.

    During the Perl 5 era, the release of Perl for Win32 was also seen-the Microsoft Windows port of Pert. This port, which was funded by Microsoft for inclusion in its Windows NT Resource Kit, was developed by Hip Communications. Dick Hardt, the person at Hip who is widely known as the driving force behind getting Perl for Win32 started, went on to start ActiveWare Internet Corporation and ActiveState Tool Corporation. Since then, Perl for Win32 has followed Hardt, where it is now maintained, free-of-charge to the public, by ActiveState.

    What 5.6 Brings to the Table

    You are now up to the present, where in March 2000, Perl 5.6 was released to the world. Besides a new syntax for versioning and declaring subroutine attributes, Perl 5.6 adds a lot of little features that programmers have been asking for that weren't in previous editions. This includes, but isn't limited to, the following:

    Unicode and UTF-8 support

  • 64-bit support
  • Files larger than 2GB now supported
  • And even more diagnostics

    For those of you who may have some programming experience already, you might also be interested in these higher-level enhancements:

  • Lexically scoped warning categories
  • The open() function has had an argurnent added pack() function enhancements

    ...

  • Table of Contents

    Part 1: Getting Started.
    Chapter 1: Introduction to Perl.
    Chapter 2: Scalar Data.
    Chapter 3: Arrays, Lists, and Hashes.
    Chapter 4: Operators and Control Structures.
    Chapter 5: Program Flow and Subroutines.
    Part 2: Applying your Knowledge.
    Chapter 6: Working with Files and Directories.
    Chapter 7: Regular Expressions.
    Chapter 8: Interacting with Databases Using the Perl DBI.
    Chapter 9: Modules.
    Chapter 10: Writing CGI Programs.
    Chapter 11: System Functions.
    Chapter 12: Error Messages and Debugging.
    Chapter 13: Advanced Features and Concepts.
    From the B&N Reads Blog

    Customer Reviews