Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Another way may be to use a redirected 'holding pattern' script that checks a semaphore set by your main program. You could even show updates - number of files processed etc.

If your main script creates a temp file that it periodically writes a status to, and deleted when finished, it could pass this filename to "holding.cgi", which can then periodically display the status, then the results when finished - something like this...

#Main File use File::Temp; my ($fh, $filename) = tempfile( DIR => '/tmp'); my ($hfh, $results) = tempfile( DIR => '/html'); print redirect("holding.cgi?file=$filename&html=$results"); do { # process record print $fh $num_records,"\n" unless ($num_processed++ % 1000); } while($records_not_processed); # write results to $hfh # ...or just results.htm... # ...if you haven't got multiple users / datasets etc. unlink $filename; #Holding.cgi my $filename=param('file'); my $html=param('html'); if (-e $filename) { open FILE $filename; # read in last number # print some HTML... # ...that's got a META refresh in... # ...that points back to ourself close FILE; } else {print redirect($html);}
Cheers, Ben.

In reply to Re: CGI: Waiting for Output by benn
in thread CGI: Waiting for Output by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (4)
    As of 2018-10-20 04:15 GMT
    Find Nodes?
      Voting Booth?
      When I need money for a bigger acquisition, I usually ...

      Results (111 votes). Check out past polls.

      • (Sep 10, 2018 at 22:53 UTC) Welcome new users!