I do a quick-and-dirty version, no redirect, with javascript.

I output this as soon as the script starts (setting $| to 1 first of course):

<img name="progress" src="animated.gif">

which is an animated progress-bar type image -- then when the script is finished/starting to produce output I print this to the browser:

<script> document.images.progress.src='finished.gif'; </script>

Which changes the gif to one which says "done" or is just transparent.

Although of course if the perl script itself times out/fails and produces no further output they're left with the animated gif forever. That could be handled with a setTimeout() in javascript though, allowing two or three minutes then resetting the image and giving some kind of error. Your <script> block would in that case include a clearTimeout() as well. Exercise for the reader.

Please note I only ever did this for internal apps where I could be absolutely sure the users had javascript and had it turned on.



($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print

In reply to Re: CGI redirection after headers sent by Cody Pendant
in thread CGI redirection after headers sent by Losing

Title:
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, details, 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, summary, 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.