PERL Black Book


Covers Perl syntax, object-oriented programming, database programming, troubleshooting, and debugging. Details Perl functions, such as data processing, file handling, input/output (I/O), and inter-process communication (IPC). Shows how to create Perl packages and modules to reuse script code. Covers CGI in depth, including programming, security, email utilities, UNIX utilities, databases, web automation, plus much more. Written by Steve Holzner, former contributing editor for PC Magazine and the author of 50 ...
See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (23) from $2.21   
  • New (2) from $105.00   
  • Used (21) from $2.21   
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any coupons and promotions
Seller since 2015

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2015

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Sort by
Sending request ...


Covers Perl syntax, object-oriented programming, database programming, troubleshooting, and debugging. Details Perl functions, such as data processing, file handling, input/output (I/O), and inter-process communication (IPC). Shows how to create Perl packages and modules to reuse script code. Covers CGI in depth, including programming, security, email utilities, UNIX utilities, databases, web automation, plus much more. Written by Steve Holzner, former contributing editor for PC Magazine and the author of 50 computer books. There are over a million copies of his books in print. Includes 250 pages of CGI programming, the driving force behind Perl's popularity. Includes over 1,000 programming examples. Comprehensive coverage of Perl syntax and programming. If you can have only one book on Perl, this is it! Written at a higher technical level than other books currently on the market.

Includes the Perl code and modules. Includes all code developed within the book.

Read More Show Less

Product Details

  • ISBN-13: 9781576104651
  • Publisher: Coriolis Group
  • Publication date: 8/28/1999
  • Series: Black Book Series
  • Edition description: Older Edition
  • Pages: 1283
  • Product dimensions: 7.44 (w) x 9.22 (h) x 2.17 (d)

Meet the Author

Steven Holzner (Cambridge, MA) is a former contributing editor for PC Magazine and has authored 50 books ranging in subject from assembly language to Visual C++. His books have sold over a million copies and have been translated into 15 languages. Holzner was on the faculty of Cornell University for 10 years, where he earned his Ph.D. and has also been on the faculty of his undergraduate school, Massachusetts Institute of Technology.
Read More Show Less

Table of Contents

Chapter 1: Essential Perl
Chapter 2: Scalar Variables And Lists
Chapter 3: Arrays And Hashes
Chapter 4: Operators And Precedence
Chapter 5: Conditional Statements And Loops
Chapter 6: Regular Expressions
Chapter 7: Subroutines
Chapter 8: Formats And String Handling
Chapter 9: References
Chapter 10: Predefined Variables
Chapter 11: Built-In Functions: Data Processing
Chapter 12: Built-In Functions: I/O
Chapter 13: Built-In Functions: File Handling
Chapter 14: Built-In Functions: Interprocess Communication
Chapter 15: Standard Modules
Chapter 16: Perl/Tk-Windows, Buttons, And More
Chapter 17: Data Structures And Databases
Chapter 18: Debugging And Style Guide
Chapter 19: Creating Packages And Modules
Chapter 20: Creating Classes And Objects
Chapter 21: Object-Oriented Programming
Chapter 22: Internet And Socket Programming
Chapter 23: CGI Programming:
Chapter 24: CGI Programming With Other Popular Package
Chapter 25: CGI: Creating Web Counters, Guest Books, Emailers, And Secure Scripts
Chapter 26: CGI: Creating Multiuser Chat, Server Push, Cookies, And Games
Chapter 27: CGI: Creating Shopping Carts, Databases, Site Searches, And File Uploads
Chapter 28: Handling The Web In Code Index
Read More Show Less

First Chapter

In Depth

This chapter covers the fundamental Perl skills that we'll rely on in the coming chapters. In the next few chapters, we're going to see a great amount of Perl syntax at work, but none of that is any use unless you can get Perl running and create programs with it. That fundamental set of skills-creating and running Perl programs-is the topic of this chapter.

Here, we're going to work through the mechanics of creating Perl programs, from installation issues to writing Perl code, from making sure your Perl program can find the Perl installation on your machine to displaying simple output. These skills are ones we'll need in the coming chapters. The material in those chapters is all about the internals of writing Perl code; this chapter is all about the rest of the process that makes that code run.

You're likely to know much of the material in this chapter, in which case it will provide a review. (Some of the material is bound to be new; off the top of their heads, for instance, very few people know what all the Perl command-line switches do.) If you already have a working installation of Perl, and can write and run basic Perl programs, you're already familiar with most of what you'll see in this chapter, so just skim the following pages and continue with Chapter 2.

This book is written to be as comprehensive on the subject of Perl as one book can be, and covering the basics of creating and running Perl programs is essential information.

All About Perl

Taking a look at the history of Perl is instructive: If you know how Perl grew up, you know why it concentrates (sometimes unexpectedly) on various programming areas and can be thin in others. To the uninitiated, the structure of Perl can seem a little haphazard at times (for example, why does it expend so much effort on regular expressions to handle string matching?). Unraveling its history helps unravel those mysteries.

Perl was created in 1986, as a tool to track system resources across a network (called a configuration manager tool). To set the record straight, Perl is an interpreted language that was originally designed to scan text files, extract information from those text files, and display text-based reports using that information. In other words, it was built to handle, process, and format text. In fact, the name itself stands for Practical Extraction and Reporting Language (also affectionately known as the Pathologically Eclectic Rubbish Lister, as well as many other names, like the Swiss Army Chainsaw, which refers to the fact that you can do nearly everything in Perl in many different ways, and some of them are pretty forceful).

TIP: You might ask: Why "Perl" and not "Pearl"? It turns out that a graphics language called Pearl already existed when Perl was created; even so, note that the actual acronym of the Practical Extraction and Reporting Language is, in fact, Pearl if you include all the words.

An interpreted language like Perl is parsed and executed at runtime instead of being compiled into binary form and then run (although a Perl compiler is being developed). That is, you use the Perl interpreter named perl (note the case difference) to run Perl programs. And note that although I've been using the generic term program up to this point, it's more correct to refer to Perl code as scripts, as with other interpreted languages.

With other languages, such as C++, you create a binary executable and then run it. Using an interpreted language has advantages and disadvantages; the primary advantage is that it cuts time you invest in the development/testing cycle. Instead of having to run your code through a compiler each time you want to test it, you can run it immediately using the Perl interpreter. On the other hand, compiled programs almost always run faster and don't need an interpreter installed on the machine in which they run (you'll need a Perl installation on the machine in which you want to run Perl programs). However, the typical Perl program today is not a long one-usually a CGI script a few pages in length or code that acts as glue binding together operating system shell commands-so execution time is often not a significant factor.

It's worth noting that, increasingly, people are writing longer Perl scripts because Perl has evolved into a cross-platform language that is the center of a thriving cybercommunity. Perl was born in Unix, but it has spread to just about every operating system out there, and it's substantially the same on all of them. Because you don't need to create binary executables, you can easily port your scripts to all those operating systems. In fact, it's no longer possible today to write serious Perl books under the assumption that all readers are Unix programmers; although many books make this mistake, that's living in the past. Perl today is a cross-platform language and must be treated that way, not as limited to one particular operating system (and how much help is it to a Windows programmer to describe something as awk(1)-like or to say it works just like sed(1)? Better to explain such things in ways everyone concerned can understand).

Some people wonder at the popularity of Perl-a text-based language designed to be run from the command-line-in a world of graphical user interfaces like Windows. Perl's continued and growing popularity is based on a number of factors: First, of course, is that many operating systems remain primarily text-oriented. Another is that Perl is a cross-platform language, supported on many different operating systems to a remarkable degree, differing across platforms only in some unavoidable ways (such as the number of bytes used to store long integers in the host computer).

In addition, Perl actually has become graphical by interfacing with the popular module (as we'll see in Chapter 16), allowing it to use the popular graphical controls (called widgets) in the Tcl language's Tk toolkit. Using the module, you can display windows with buttons, menus, and more from Perl.

However, on the basis of a sheer number of programmers, Perl's recent popularity has been fed most these days by Common Gateway Interface (CGI) programming, which you use to perform Web-based client/server operations. It's no drawback to use a text-based language when you're creating Web pages, which are themselves text-based. CGI programming in Perl is very powerful and-correspondingly-it's one of the major topics we'll cover.

That's enough introduction. It's time to start creating Perl scripts and seeing what goes into the process.

Immediate Solutions

Getting And Installing Perl

The big boss gives you a call-as usual, at the last minute. You have 20 minutes to write a new application that will convert text files between various formats. What are you going to do? Knowing how well Perl works with files and handles text, you select Perl as the language of choice to get the task done. Of course, you've got to make sure you have it before you can use it.

Perl is free; all you have to do is download it and install it. If you're on a multiuser computer, you may already have Perl installed; try entering the following at the command-line (I'll use % for the command-line prompt in this book):

%perl -v

Here, I'm using the -v switch (a switch is a command to the Perl interpreter, and it starts with a hyphen,-). If Perl is installed and in your path, this command will display the current Perl version and patch level. (Perl patches are periodically released to fix individual bugs.)

Note that on some systems, the default Perl interpreter is an earlier version of Perl, such as version 4. To use Perl 5 on such a system, you use a command such as perl5 (try the following if perl -v indicates a version of Perl before version 5):

%perl5 -v

If you don't have Perl installed, go to (Europeans may prefer a European mirror such as or CPAN is the Comprehensive Perl Archive Network, an extensive resource that we'll see more about throughout this book. From those sites, you can find and download all that you need.

We're (intentionally) not going to cover the installation techniques you use on various operating systems to install Perl. Not only are those techniques detailed very carefully and well on the Perl site (such as the Unix installation tutorial at, but they are also subject to future changes that would not be reflected in this book. (Many books have made themselves obsolete by giving detailed installation instructions, such as those for the Java language-which then changed almost immediately with newly released versions.)

As of this writing, you can get the latest version of Perl most easily by clicking on the "Get the latest version of Perl" link at This link connects you to, giving you direct links to the most popular ports (that is, system-specific implementations) of Perl, such as ActiveState's Perl for Win32 (make sure you get version 5.005 or later to ensure your Perl for Win32 is compatible with Unix-based Perl and Perl modules-earlier versions had some incompatibilities), the Macintosh port named MacPerl, and the many Unix ports. What types of Unix is Perl supported under? Following is the short list:

  • AIX 3, 4
  • BSD/386 1
  • ConvexOS 10
  • DG/UX 5
  • Digital Unix/DEC OSF/1 1, 2, 3, 4
  • Free/Open/Net BSD
  • HPUX 9, 10
  • Interactive 3
  • IRIX 4, 5, 6
  • Linux 1, 2
  • MachTen 2, 4
  • NextStep 3, 4
  • SCO 3
  • SunOS 4, 5
  • Ultrix 4
  • UNICOS 6, 7, 8, 9

Perl is supported under nearly every type of Unix available; in fact, as far as I'm aware, the only types of Unix that it's not supported under are very early versions, such as those for some PDP-11s that don't have enough resources available.

The usual starting point to get Perl is, and the latest version page, Download the Perl port that makes sense for you, and follow the installation instructions to install Perl.

Besides, you can also get anything Perl-related at CPAN. CPAN is a practically endless source of Perl modules, packages, utilities, ports, and more. The creators of CPAN describe it this way: "The CPAN contains the collected wisdom of the entire Perl community: hundreds of Perl utilities, several books' worth of documentation, and the entire Perl distribution. If it's written in Perl, and it's helpful and free, it's in the CPAN."

To get to CPAN, go to You can automatically be connected to the CPAN mirror nearest you if you navigate to (the case in this URL is important). If you omit the final slash-that is,'ll see a list of the CPAN mirror sites and can select one you want.

Read More Show Less


Welcome to the big book of Perl. This book is designed to be as comprehensive, and easily accessible, as is possible for one book on Perl to be. In fact, this book is written to have as much coverage as any two of its competitors-and adds hundreds of pages of CGI Internet script programming to boot.

Perl is no ordinary programming language: It inspires devotion, passion, exaltation and eccentricity-not to mention exasperation and frustration. It's more than a programming language; it's a cause, the stuff of programmer poets and fanatics. Perl may be complex and arcane at times, it may even be confusing and inconsistent, but to a true devotee, there's no other way to go. You'll see what I mean as you read this book.

In its 12-year reign, the Practical Extraction and Reporting Language (also called, often by the same people, the Pathologically Eclectic Rubbish Lister) has become the object of much affection. Remarkable numbers of people devote incredible numbers of volunteer hours to using, improving, and disseminating it. I started working with Perl years before I thought of writing a book on it. Maybe the Perl way of doing things will turn you into a fanatic, too. It's really hard not to get exhilarated by the amazing amount of power you have when using Perl-everything from object-oriented programming to Internet socket programming, from writing Internet shopping cart programs to creating Web servers. We'll do all those things here.

What's In This Book

This book is designed to give you as much of the whole Perl story as one book can hold. We'll see not only the full Perl syntax-from creating simple scalars to complex data structures,from object-oriented programming to extending Perl using C-but also every major programming area in which Perl is used today.

Hundreds of real-world topics are covered in this book, such as connecting Perl to databases, to Windows OLE automation servers, to other processes, and so on; they're all here. We'll cover file handling, socket programming that lets your programs communicate across the Internet, powerful text processor applications, object-oriented programming, named pipes, interprocess communication, data encryption, signal handling, module creation, debugging, Perl references, function templates, signal handling, and many more topics. And, each of these topics will come with examples showing just how they work.

Another popular topic is the connection between Perl and Tcl/Tk, which lets you display windows, buttons, menus, and more using Perl, so that's another topic in this book. We'll see everything from displaying Tk buttons, scrolling lists, and checkbuttons to letting the user handle involved cascading menus with radio buttons and submenus.

Probably the biggest source of Perl's popularity today is the Internet, so we're going to see a tremendous amount of Internet programming in this book-handling the FTP and HTTP protocols, Telnet, email-even downloading posts from Usenet newsgroups. We'll see how to download and upload Web pages, extract links from those pages, submit HTML forms to CGI scripts without using Web browsers, enable online user registration, write an HTTP user agent (that is, a Web browser), and even write a functioning Web server.

The real fuel behind Perl's popularity today is Common Gateway Interface (CGI) programming-those Internet scripts that make your Web pages come alive, allowing you to write programs that themselves write Web pages. This book contains a lot of CGI programming-in fact, more than in any one CGI book that I'm aware of. I'll cover how to create and use nearly all the HTML controls in Web pages-text fields, text areas, checkboxes, scrolling lists, radio buttons, password fields, pop-up menus, hidden data fields, Submit and Reset buttons, and more.

We'll see how to create image maps and frames, upload files, debug CGI scripts, ensure CGI security, and determine what kinds of image files you can send to a specific browser. We'll create image-based Web page hit counters, a guest book, CGI scripts that can send email, a multiuser chat application, Internet games, and cookies. We'll also implement Web site searches, create CGI shopping carts, and more. The CGI scripts in this book can redirect browsers; handle Web-based databases; handle client pull, server push, and server-side includes; return images; and more.

In this book, you'll also see many additions to Perl 5, such as ways to write more readable Perl code, BEGIN and END blocks in packages, POSIX compliance, object-oriented programming, arbitrarily nested data structures, lexical scoping, enhanced use of modules, and other topics. Version 5 presented a big change for Perl, so it's the version this book was written for.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted May 1, 2008

    A Classic

    This book is indispensible, even eight years after publication. I have a shelf full of programming books - mostly Perl - from a very well-known publisher, but I always consult the Holzner text first and often it's all I need.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted August 1, 2000

    Excellent book

    This is one of the only books I have found on Perl that actually speaks in English rather than computerese. The examples in the book are great. Goes into details on how to write graphical counters, shopping carts, chats, etc.. And large sections on OOP and CGI programming.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 14, 2000

    A Knockout Winner!

    This book is the most accurate, detailed and comprehensive guide to Perl I have ever seen! The examples alone are worth the cover price, but the added details really leave no stone (and few pebbles) unturned. A reference to carry you from beginner to pro.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 17, 2000

    just so-so

    The book isn't bad but as it says in the text its not very good to be read sequentially from start to finish. Its also very repetitive(which to me is annoying)..I guess thats a side effect of not being meant to be read cover to cover. Also I think it has too many source code examples. They could discuss much more material per code example.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)