Turning Perl into CGI
So now you have the Perl basics down, and you’re no doubt itching to put that know-how to work. Well, being acquainted with Perl’s one thing, but turning Perl into a keen CGI script is a whole ‘nother ball of wax. Hence, Lesson Two of Colin’s wonderful world of scripting.
These days there are all kinds of super wonderful libraries and Perl Modules that can make CGI scripting easier and niftier, but we’re all about basics here today. My daddy once told me that you’ve got to learn to walk before you can river-dance. So today we’re going to stick to super basic, almost prehistoric, though still really nifty Perl to put together today’s little project. Tune in at a not-so-distant-future date when this simian will take a look at the Perl CGI module.
Before we begin, there are a few more things you must know before you tackle phase two.
- You need to know how to make a form in HTML. If you can’t to do this yet, learn it and come back. It’s really easy and should only take five minutes to learn (ten if your last name’s Gump).
- Scripting requires a certain concentration, which can be brought on by the right music. Personally, I’ve found The Pixies and They Might Be Giants to be proven script enhancers.
- CGI is frustrating. Rather than lash out at a co-worker, little brother, or computer, a big heavy punching bag can help ease the strain. (Of course, if things prove too much for you, you can always go back to stealing other people’s scripts.)
And that should do it. With these things under control, you’re ready to jump into today’s lesson. We’ll examine the differences between Perl CGI and Perl scripting, and we’ll build a small script to illustrate just how nifty CGI really is.