http://www.perlmonks.org?node_id=104093


in reply to Creating new HTML files and accessing them later.

I've written something similar to what you are suggesting for my own site (linked from my homenode).

I used flatfiles for the first version and I am currently in the process of switching over to a mySQL setup. If at all possibile, I would suggest using a database of some kind. This would allow you so much more flexability down the road and perhaps some performance boosts too but that depends on the traffic really.

With either a database or a flatfile arrangement, a single perl script that handles the html (much like the index.pl here) would make changes to the look of the site and maintance *much* easier and quicker.

As for new sections, in a sql enviroment you could have a column that states the type of page like comment, story, userid etc and dump data into that. If you use flatfiles, then I would just put the data (the meat, not the whole page) in a file in a directory that only new stories go in or use a proprietary extention.

you really should look at HTML::Template and CGI. HTML::Template would make it easier for a non-perl person to maintain the html and CGI just makes CGI easy. there is a HTML::Template tutorial here and Lincoln Stein's tutorials here.

The most important thing to do is to plan out where things are going to be and how they will look to the user and stick with that. I made it an everchanging process as I went and it took forever because the changes I made meant a re-write of the code.

Good luck and feel free to msg me if you like.
-p

  • Comment on Re: Creating new HTML files and accessing them later.