in reply to cgi with sleep

Try adding the current line number as an argument to your CGI and insert a refresh meta-tag in the HTML with the desired delay and the next line number of the poem in the URL.

Replies are listed 'Best First'.
Re: Re: cgi with sleep
by davido (Cardinal) on Apr 01, 2004 at 17:53 UTC
    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