in reply to Page refresh, timings and simulations

Corion, I may have misled you slightly - the simulation is a real time one that is on-going for several weeks. What is required is that the simulator program starts up on its dedicated PC in the morning when it is turned on and runs through the day until it is switched off at night. The display program also runs on this dedicated PC showing real-time analysis and summary information, taking the feed from the simulator every 10 seconds (after each stage) and displays this data.
What I want is for the cgi program displaying the data to show a new page every 10 seconds, rather than (at the moment) tagging the HTML page on to the bottom of the previous one. Does that help any?
  • Comment on Re: Page refresh, timings and simulations

Replies are listed 'Best First'.
Re^2: Page refresh, timings and simulations
by Corion (Patriarch) on Jun 02, 2009 at 09:27 UTC

    Ah - so you have already separated the two. You might just be able to show us the relevant part of your CGI program which produces the output, but I presume your program currently still looks like the following:

    #!perl -w use strict; use CGI; do_all_the_initialisations; while (1) { my $information = get_information; print <<HTML; This is my HTML page with $information };

    And basically, that's not how CGI works. A CGI program is supposed to output one page worth of HTML and then exit. So you will either need to get rid of the loop and (re)do the initialization, or create the HTML page from a third program every 10 seconds and just serve that page as a static HTML file.