Gossamer Forum
Home : General : Perl Programming :

How do you display a scripts actions as they happen and not after the script is fin..

Quote Reply
How do you display a scripts actions as they happen and not after the script is fin..
What I want to do is like nph-build.cgi - Instead of it printing that page after the script finishes, I want it to print each action as it happens. How do you do that?

------------------
Quote Reply
Re: How do you display a scripts actions as they happen and not after the script is fin.. In reply to
Prefix the script filename with "nph-" to tell the webserver that the script is running as "non-parsed headers" (which is what nph stands for). Be aware that MSIE doesn't deal with non-parsed header scripts correctly, and will invariably not display the content until it is finished processing. I think that is an ongoing thing and as yet (MSIE5) hasn't been addressed.

To "con" the user into thinking the script is running as non-parsed headers, i.e. feeding information to them as you're processing, use multiple scripts or multiple calls to the same script, passing the information to the script(s) via META refresh tags.

adam
Quote Reply
Re: How do you display a scripts actions as they happen and not after the script is fin.. In reply to
yea... plus you have to put

print

instead of something like

$output..

blah blah and then at the end..

print $output;