damian has asked for the wisdom of the Perl Monks concerning the following question:

dear fellow monks, i have this small site where i want to implement automatic updates. example my index.html contains comment tags like these. and this can be used for the script to indetify which part of the html file it will modify. then i have for example a template file which contains html tags that the script will read and paste that contents to the html file which has the comment field above. will you require me to use mysql database for this? thanks, arvin

Replies are listed 'Best First'.
Re: Automatic updates on sites.
by davorg (Chancellor) on Jul 11, 2000 at 13:13 UTC

    How frequent are the updates? Perhaps you could run a cron job every hour (or whatever is appropriate) which creates a new set of HTML files. That way, your visitors only ever see static HTML files which will make the site faster for them.

    Another option might be for the process which changes the information that you are displaying to regenerate the HTML files once it has finished the update.

    I'd recommend looking at the Template Toolkit to handle the template expansion.

    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000, ICA, London
    <http://www.yapc.org/Europe/>
      hi fella monk, actually some of the sites will be updated daily and some are hourly. and yes i'm planning to run cronjobs so that server load will be much lighter. as much as possible i don't want to embbed perl within html files, i have templates separated on a file and the perl script will just replace the original html tags with tags on my template. as much as possible embbeding perl within html files will have a heavy server load especially if you have so many parts of the page updated. thanks again fella monk.
(crazyinsomniac) Re: Automatic updates on sites.
by crazyinsomniac (Prior) on Jul 11, 2000 at 13:11 UTC
    Hi,

    It depends, how long do you wish to keep these updates?
    How many of them are there on average?
    Where are you getting them from, some other site, or do you type them in?

    I would suggest use a mysql database, no matter what. It's a good learning experience.

     ______________________________________________
    |_____¸.·ooO--(> cRaZy is co01. <)--Ooo·.¸_____|
     ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
    
RE: Automatic updates on sites.
by t0mas (Priest) on Jul 11, 2000 at 13:13 UTC
    If you want to display HTML like tags, use <code> tags, otherwise they will not show.
    Like:
    <!--begin tagone--> and <!--end tagone-->
    If I understand your questin correct, you want to insert tags in your html files, run them through a perl script where you repace the tags with the contents from another file.
    You will not need to use any database just to replace some part of a file with some part from another file but if your site is heavily updated by many persons it may be an advantage to have one.
    Using a database from the begining will reduce work for you later, if your site grows and you realize that you need one.

    /brother t0mas