Thursday, August 16, 2007

Beginner's Guide to CGI Scripting with Perl

Introduction

This page is designed to help novice programmers learn the Perl programming language. Specifically, it's designed to help them learn enough to run CGI scripts on a Unix Web server.

This page grows out of my own experience. When I started out on the Web I was new to Unix, and had no formal training as a programmer. I wanted to create dynamic pages for my Web site, though, and everyone said Perl was the way to go. They were right: It was the way to go. It sounds trite to say that "Perl changed my life," but that's basically what happened.

Still, it was an uphill battle. In particular, many of the resources for learning Perl seemed to assume that I was already an experienced programmer, or at least an experienced Unix user. I've made some assumptions in these pages, but not those assumptions.

Assumptions I do make:

  • You're reasonably intelligent.
  • You're an experienced computer user, of the Windows (or possibly Mac) persuasion.
  • You know, or are willing to learn elsewhere, the basics of HTML, including things like and tags.
  • You have, or are willing to get, an Internet account that lets you log into a Unix shell session, and install and run your own CGI scripts.

Before you get started, I'd like you to take a moment to consider the quotation at the top of this page. As a beginner, you'll find that the combination of Unix and Perl gives you more than enough rope to hang yourself. One of Perl's claims to fame is that it makes "easy things easy" - which it does, but among the things it makes easy are the accidental mangling of your files, or the opening up of gaping security holes on your Web server. So be careful. Or, as Perl's creator, Larry Wall, likes to say, "have the appropriate amount of fun."

No comments: