When I first started writing web pages, they were always static pages: straight HTML. If there was any CGI at all, it was only to handle forms. No doubt every beginning web master starts out that way, and if your web site never grows beyond a handful of pages, that's probably fine. However, as your site grows in complexity, static pages become burdensome and quite annoying to maintain.
For example, let's look at the various things that need to happen when I add a page to my site:
All of this is handled by Perl scripts. The generation of the style sheet classes and the copyright notice is just simple SSI (Server Side Includes): a line in each file has this, for example:
<!--#include virtual="/cgi-bin/copyright.pl" -->
As you may already know, such a line (on a server that supports SSI) will cause the displayed web page to have the text generated by the script that it calls. The "copyright.pl" generates the boilerplate copyright, and a similar line generates the style sheets.
The rest of it all happens because one line that describes the article is added to a data file that a number of other programs read. That data file looks like this:
ARTICLES:/Unixart/linppp.html:Red Hat Linux as a PPP Server:January 1999:Tony Lawrence:Linux|Networking ARTICLES:/Opinion/java.html:Java? :January 1999:Tony Lawrence:Opinion ARTICLES:/Reviews/wt5.1.html:Winterm 5000 Terminal:January 1999:Tony Lawrence:Reviews|Modems/Terminals|Networking ARTICLES:/Reviews/proxyserv.html:Review of Netscape Proxy Server:February 1999:Tony Lawrence:Reviews|Security|Networking ... ARTICLES:/Unixart/linkfail.html:Kernel Link Failures:September 2000:Tony Lawrence:Installation|Kernel/Internals ARTICLES:/Reviews/logmon.html:Logmon Inactivity Reporter:September 2000:Tony Lawrence:Reviews ARTICLES:/Opinion/technofable.html:Technofable- James Richardson:September 2000:James Richardson:Opinion ARTICLES:/Linux/linrh70.html:Red Hat 7:October 2000:Tony Lawrence:Linux|Reviews ARTICLES:/Unixart/vdom_eng.html:Mail in a Virtual Domain:October 2000:Roberto Zini:Mail|Installation
Every index page gets information from this file by way of a Perl script. Additionally, every page shows pages related to itself by another script that also reads this file.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2012-07-15 Tony Lawrence
AOL is like the cockroach left after the nuclear bomb hits. They know how to survive. (Jan Horsfall, VP of Marketing for Lycos)