That's exactly the ticket. Don't expect to be able to print to a web browser as though it's a terminal window; you just can't do it reliably. Browsers load once, and then sit there. You can't just print, wait awhile, and print again; the browser won't be refreshed.

But setting a meta-tag to refresh/reload every five seconds, for example, enables you to have multiple opportunities to print. Then it's possible, the CGI programmer to use hidden fields of some sort (or encoded URL's) to keep track of what's been printed and what needs to be printed in the next cycle.

That way, in the first cycle, you'll print line one. In the second cycle you'll print line one, and line two. And so on.

Unless you want to fiddle with javascript or flash, that's how you're going to have to handle it.


Dave


In reply to Re: Re: cgi with sleep by davido
in thread cgi with sleep by Anonymous Monk

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.