The code you provided isn't very helpful. Are you saying that the script itself fails, or that the script works in the background, and the web page won't refresh? There is a big difference, and there are very different answers to each question.

print $query->redirect("New URL goes here");

The script doesn't fail, it's the redirect header that's not being honored by the browser because Apache hasn't dropped the connection. The redirect will go through once the process ends (a good three or four minutes later.) To shortcut that wait, I fork and the parent dies.

Now that I've re-read your post a couple of times, I like that you presented a viable alternative to my redirect/fork trick. Why not print a page to the browser asking it to refresh itself to the page I want? That's so simple and obvious compared to redirect/fork. I'll try it and post back when it works.

Thanks as well for the Javascript update % idea. I wasn't aware that Javascript could reach out to the web and read in another page outside the current one. Javascript gives me the willies though because of how difficult it is to make a script work in every browser. Maybe I'll take a look at it again in the near future.


In reply to Re: Re: CGI, fork, long processes on Apache 2 by Anonymous Monk
in thread CGI, fork, long processes on Apache 2 by Anonymous Monk

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.