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.


In reply to Re^2: Page refresh, timings and simulations by Corion
in thread Page refresh, timings and simulations by gsd4me

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.