PhoneBoy Rants About: Writing Programs to Generate Web Pages!

Another change that occured this week: The frames bar containing the audio has been made smaller and more compact. This gives more browser window real estate for the weekly reports. That's not nearly as interesting as how I implemented the change: by writing a program to do it for me.

The hardest thing about maintaining a website is updating existing content, especially when all you're doing is just changing the look. If you have a lot of HTML files to edit and make changes to, it can be time consuming! In many cases, a lot of those pages look basically the same. In my case, a lot of my pages are similar and have one basic difference: the date. It's either the date itself or something based on the date. Editing all these pages is tedius to save the list. What I ended up doing to make my life simpler was create a series of template documents that had everything in it but the places where it needed the date. In those places, I simply put a "marker" where I wanted the date to go. I then wrote a program that would take those "markers" and replace them with the date in whatever format I wanted.

Forutnately, I have shell access to the system on which I serve my web pages and they have Perl installed. Perl stands for the Practical Extraction and Report Language, and was developed by Larry Wall as a tool to easily manipulate files and other data streams. It combines the best parts of various Unix tools like awk, sed, and the programming language 'C' into a sort of scripting language that is both fast and powerful. Perl is often used for CGI programs, which are programs that interface with the web. Aside from being available for Unix, Perl is available for Windows 95, which means you can also take advantage of its many uses.

For those of you interested in learning Perl, let me recommend "Learning Perl" by Randal Schwartz (published by O'Reilly and Associates, ISBN# 1-56592-042-2). Or, if you're already familar with C, awk, sed, and shell programming, you might be able to do like I did and jump right into "Programming Perl, 2nd Edition" by Larry Wall, Tom Christiansen, and Randal Schartz (also by O'Reilly, ISBN# 1-56592-149-6). Both these books are somewhat technical and you may not be able to find them in your local bookstore. O'Reilly allows you to order the books thru their website if you're not lucky enough to live in some high-tech mecca like the Silicon Valley. Me? I can just go down to my local Computer Literacy Bookstore and pick them up.


Last Update: 18 July 1997
Return to PhoneBoy's Internet Guide