Alan said:
Was that wise? While it seems to have got the questioner off our
backs, I'd have to say that if it were to be presented as a solution
in a WWW group (which is where I suspect it would be more on-topic,
since there's almost no specifically Perl-language relevance here), it
would likely have been shot down in flames.
I did give it some thought, and decided that the expedient solution
would be worth it, if only to reduce flamage and allow other threads
of discussion to prosper.
There's just too many imponderables being left to the client side
(who'd be perfectly entitled to disable frames and/or images if they
felt like it) for this to rate as a robust piece of web engineering,
I'm afraid.
No frames: taken care of. Both no frames and no images: only the OP
would know if that would be a concern for his expected audience.
As for robustness, I expect the OP will eventually realize that he
had 95% of the solution with the script that use LWP twice.
I would have done it this way:
1) Output the HTTP and HTML headers immediately, to give the user
feedback. This would include sending <BR>, <HR>, <P></P>, or other
HTML tag that forces a line break, so that the browser will
render the partial page. (No <table> at this stage.)
2) Execute an LWP request inside the CGI, with a suitable timeout
being set. When the results come back, output more HTML, with
another line break.
3) Do post-processing. This could be fork()+exec(), system("... &"),
or just let the browser sit and wait for processing to complete.
[I've seen one CGI output <HR width="10%">(pause)<HR width="20%">,
etc as a pseudo progress bar.]
-Joe