Displaying progress in CGI - long running scripts

E

egoduk

I've been using Perl for about a year, and have written a number of
useful scripts. They all take minutes to run, constantly updating the
user if run interactively or writing to a log if run via cron.

I'd like to change the user interface from a Unix shell to a web page,
so have been looking at a few CGI intros. I can't see how I would use
CGI to update the user on the scripts progress.

Can anyone suggest any examples/tutorials?

Thanks,

Edward
 
A

A. Sinan Unur

(e-mail address removed) wrote in @g43g2000cwa.googlegroups.com:
I've been using Perl for about a year, and have written a number of
useful scripts. They all take minutes to run, constantly updating the
user if run interactively or writing to a log if run via cron.

I'd like to change the user interface from a Unix shell to a web page,
so have been looking at a few CGI intros. I can't see how I would use
CGI to update the user on the scripts progress.

Can anyone suggest any examples/tutorials?

Google is your friend:

<URL:http://www.google.com/search?q=watching+long+cgi>

Sinan
 
X

xhoster

I've been using Perl for about a year, and have written a number of
useful scripts. They all take minutes to run, constantly updating the
user if run interactively or writing to a log if run via cron.

I'd like to change the user interface from a Unix shell to a web page,
so have been looking at a few CGI intros. I can't see how I would use
CGI to update the user on the scripts progress.

Can anyone suggest any examples/tutorials?

If they are just a few minutes long, I find this very simple method
helpful:

use strict;
use CGI;
$|=1;

##blah blah blah

foreach (@stuff) {
##blah blah blah
print ".\n"; #progress meter, plus try to ward off time outs
};
print "<hr>\n";
# print rest of output page


For fancier stuff, you've alreaby been pointed to the meta refresh ala
Randal's column.



Xho
 
D

Dave A.

I've been using Perl for about a year, and have written a number of
useful scripts. They all take minutes to run, constantly updating the
user if run interactively or writing to a log if run via cron.

I'd like to change the user interface from a Unix shell to a web page,
so have been looking at a few CGI intros. I can't see how I would use
CGI to update the user on the scripts progress.

Can anyone suggest any examples/tutorials?

<http://search.cpan.org/~lds/CGI.pm-3.10/CGI/Push.pm>

You might want to take a look at MOD_PERL as an alternative to CGI,
especially if you're going to deploy Perl applications in a production
web server environment. It also tends to have the side-benefit of
breaking people from sloppy coding habits, which seems to be the rule
when writing CGI scripts.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top