
I like Perl, and I'm slowly beginning to get a little grip of it. It's really a convenient tool for things like these web pages for instance. OK, there are nice GUI HTML generators, but I don't think they get close to being as useful as my setup.
It's not that I sit with a sharp pencil and punches holes in a paper tape or anything like that, I use cut and paste and stuff, it's just that most of those who make all these GUI programs - and maybe those who buy them too - seem to disregard how these files are kept updated.
So what I did, to make things reasonably consistent here was to split up all pages in a header, a body and a footer. They all use the same header and footer. Since some things (like title) are specific for each page I decided to allow special tags that like this: [title]. The tags in the files are replaced with stuff described in an ini file.
Then I wrote a perl script which concatenates the header, body and footer for all files that have been changed since the last time I generated the HTML files, and then performes the substitutions mentioned in the ini file. Thus, the source files are kept very simple, usually just paragraphs with text and possibly a few links or images. Changes in background, icons etc are just made in one place, and a simple command will change it globally.
As a little extra I wrote another perl script which uses the ini file to generate an alphabetic list of all my files. OK, I could perhaps have done all this without any programming in almost the same time, but it's really much simpler to keep it updated like this, and what ever you think of it - it does look fairly consistent!
As I said, I'm just learning Perl, so these programs shouldn't be viewed as school book examples, but they work; feel free to try them. It would be nice if you sent me a mail if you find them useful though. If you do use them to keep up your web pages you are very welcome to put a link towards this page, to tell others about it. I've run them on a Linux box, but apart from the date command which I use in the footer, I don't think there would be any problems running them on non unix platforms.
The big project is to write WWWPPP, World Wide Web Pretty Print Program. I haven't seen any decent program for printing out web pages in a more qualified way. It should be possible to set number of columns, get links turned into foot notes and automatic generation of page index etc. That's nothig I'll do right now though... If anyone has seen these programs already, please inform me - I do like programming, but I also want the result...
It's been some time since I wrote the text above. I've added two more programs, new.pl to generate a list of the most recently changed files, and links.pl to generate my list of links from my Netscape bookmark list. I'm really happy with these little scripts. They make it really simple to keep these web pages looking reasonable, even if I slightly change my opinion about what that means now and then. I think the main issue for me now, is to make myself write shorter texts... It will take hours to read all this stuff. :-)
Last updated Tue Jun 3 12:00:14 1997 and generated Wed Jun 9 19:01:55 1999 by
ht.pl
© 1996-1997 Magnus Lyckå, Sweden.