In the Fall of 1995, I put my first CGI application on the web. It was a
modest bulletin board script which I'd hacked together from a number of
other CGI applications which I'd found in various nooks and crannies in
print and on the web; a form processing routine from Robert Mudry
("Serving the Web"), some array handling routines from Randall Schwartz
("Learning Perl"), some HTML management functions from Matt Wright
("http://www.wordwidemart.com/scripts/"), etc. Starting with such a
complex project was probably not the best way to learn about CGI of
course, but like so many CGI programmers out there in the real world, I
was assigned a project at work and nobody really cared how prepared I was
in theory. They just wanted the project completed on time.
The process of writing BBS 1.0 was frustrating to say the least. At that
time, there were very few books on advanced CGI techniques. At best,
there were CGI chapters in HTML books. And these chapters were pretty
fluffy for the most part. Most dealt in theory and provided few real,
working examples (still unfortunately the case with most of the CGI books
coming out weekly).
Examples existed on the web of course. Freeware and shareware scripts
were available, but most of them were difficult to find and even more
difficult to understand, written as it were, for the wizard rather than
the beginner. I spent many, many hours with "Learning Perl" by Randall
Schwartz in one hand and a printout of some CGI application in another
trying and trying to decrypt the routines.
One four AM morning, red-eyed and dizzy, I vowed that if ever I got a
script to run, I would not only make the script freely available to
others so they would not have to struggle like I did, but that I would
attempt to document each design decision I made and every type of Perl
trick I used so that I, two months earlier, would have been able to pick
it up, read it through and have a pretty good idea how it worked. This
was the conception of Selena Sol's Public Domain Script Archive.
Over the next nine months, I slowly populated the site with CGI script
after CGI script, added a FAQ, an offsite resource section, a help found
area and various other services. The hope was to provide an area in
which new CGI programmers and experienced CGI programmers could learn
from how I wrote scripts by detailed examples and for them to share their
own ideas with me as well.
The site was a fantastic success. Thousands of netizens stopped by and
hundreds sent me notes explaining how the "learning by example method"
was an effective way for HTML programmers to make the transition to CGI.
Dozens of visitors took my scripts and ported them successfully to other
systems and other operating systems all over the world. Dozens more
offered me all sorts of job offers from full time positions to freelance
projects (proving to me again that Intellectual Property in the
Information Era is bunk). Finally, I was contacted by Michael Sprague,
the managing editor for this book, who asked me to create a print version
of the web site for all of the netizens who wanted to study CGI at the
beach or in the metro.
Excited, I contacted Gunther Birznieks who had begun to take an active
role in contributing knowledge to the Script Archive and who I knew to be
a true Wizard. Together, we developed the book which you now hold. We
hope that this will be accessible to beginners and educational for the
experienced. All comments, questions and error reports are welcomed.
Please send email to Selena Sol at email@example.com or to Gunther Birznieks
at firstname.lastname@example.org. We will do our best to answer all
email, but in some cases it might take awhile. Enjoy the book.
P.S.: I can't believe you actually read the Preface, how rare!
- Selena Sol