Chapter 1. Introduction

Jon Orwant

This book is a collection of 39 articles about Perl programs that create things to look at: web pages, Perl/Tk applications, and for lack of a better word, pictures. Much of Perl’s success is due to its capabilities for developing web sites; the Web section covers popular topics such as CGI programs, mod_perl, spidering, HTML parsing, security, and content management. The Graphics section is a grab bag of techniques, ranging from simple graph generation to ray tracing and real time video digitizing. The final third of the book shows you how to use the popular Perl/Tk toolkit for developing graphical applications. Perl/Tk programming is different from conventional Perl programming, and learning it takes a little effort, but it pays off: once you’ve got the basics down, you can create standalone graphical applications in minutes—and they’ll work on both Unix/Linux and Windows without a single change.

There are still some people who think of Perl as a language tailored for text processing or system administration, simply because it’s so good at those duties. But Perl has emerged as a compelling choice for visual tasks as well—not because of any intrinsic support for graphics, but because it allows you to program quickly regardless of the problem domain.

Never underestimate the utility of rapid prototyping. Many programmers enjoy programming because, when you get right down to it, they’re impatient. We hate the delayed gratification inherent in other endeavors. A biological experiment might take months before revealing success or failure; a mistake in March might not be discernible until July. If you write an article or a book, it’ll be months before you can see it in print. Programming, in contrast, is kinder. You can run a program and know immediately whether it works. Programmers receive little bits of gratification all along the way, especially if the programs are built in parts and snapped together (as all serious programs should be).

That goes double for Perl; its expressivity, speed, and interpreted nature give its users near-instant gratification. Perl programmers spend less time waiting.

It goes triple for visual problem domains. Pictures are the most effective way we know to convey large amounts of information. You can tell at a glance whether your web page or data visualization worked, far faster than linearly scanning a ranked list or otherwise examining textual data. The best way to interpret complex phenomena is by exploiting the inherent parallelism of the human visual system, whether the domain is protein folding, financial planning, or (more generally) finding patterns in data with many dimensions. In fact, one of the quickest ways to find patterns in data with more than three dimensions is to map each dimension onto a feature of a human face—noses, eyes, and so forth—and then view all the faces at once. These are called Chernoff faces after their inventor, the statistician Herman Chernoff.

First up: the Web articles, introduced by one of the seminal figures in web development: Lincoln Stein, the inventor of the Perl CGI module.

Get Web, Graphics & Perl/Tk Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.