| [reply] |
I'd suggest you the use of NPH, which is the support for continuosly sending information to the client without closing the conection. This is how most webchat clients work. Here is a good explanation of a non-parsed headers cgi.
| [reply] |
Another option, building upon the column by merlyn linked to by atcroft, would be to employ the Javascript XMLHttpRequest object to communicate with the server and update an element of your web page with the progress (as reported by the server) of a detached, long-running process. The advantage which this method would have (to my mind) is that you could browse away from the page and return at a later stage to check on progress (or have the process checked upon by non-initiators of the long-running process).
perl -le "print unpack'N', pack'B32', '00000000000000000000001000000000'"
| [reply] |
I was playing around with that stuff a couple of weeks ago to try and build an upload meter (something like Apache::UploadMeter but using XMLHttpRequest). I have a rough prototype of it working that you can check out here: http://cees.crtconsulting.ca/perl/examples/uploadmeter/.
It was written to work with Firefox so you may not see anything if you are using another browser.
The code is downloadable from that page, but remember that it is just a proof of concept (that means no documentation, just code). I am not using this stuff in production anywhere, but hope to wrap it up into a clean package at some point.
Anyway, back to the question, it would be pretty easy to do a similar thing with a standard progress bar instead of as an upload meter.
| [reply] |
I dont know, but maybe you only want to show that there is being activity while sending newsletters. If thats the case, you can simply use an animated gif of a progress bar inside a while() loop, and then redirect to wherever should be when finished. | [reply] |
What I do is set the script to flush the buffer after every print ($| = 1) and print a message after every email is sent, then view the output in a browser that doesn't buffer it (I use an early version of NS, but I imagine there are other options). Since this is for your own use, the output doesn't have to be pretty.
You could also use a frames layout with one frame running the script and another loading and refreshing an output file, which would be updated every email or x number of emails with the current status. | [reply] |