Displaying progress in CGI - long running scripts

Discussion in 'Perl Misc' started by egoduk@hotmail.com, Jun 23, 2005.

  1. Guest

    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
     
    , Jun 23, 2005
    #1
    1. Advertising

  2. wrote in news:1119514619.884231.122020
    @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
    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Jun 23, 2005
    #2
    1. Advertising

  3. Debo Guest

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

    That is an extraordinarily useful link... I'll have to keep that in mind
    for the next time I'm doing something like that.
     
    Debo, Jun 23, 2005
    #3
  4. Guest

    wrote:
    > 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

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Jun 23, 2005
    #4
  5. Dave A. Guest

    wrote:
    > 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
     
    Dave A., Jun 24, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anonieko Ramos
    Replies:
    0
    Views:
    560
    Anonieko Ramos
    Apr 14, 2004
  2. Anonieko
    Replies:
    1
    Views:
    21,565
    ElronVel
    Feb 4, 2006
  3. Ralph
    Replies:
    1
    Views:
    755
    Thomas Hansen
    Feb 4, 2007
  4. davidj411
    Replies:
    0
    Views:
    578
    davidj411
    Jun 27, 2008
  5. cindy
    Replies:
    16
    Views:
    2,162
    cindy
    Jul 16, 2009
Loading...

Share This Page