It needs a print statement or it will hang.

In the absence of any code, I will guess that it doesn't actually hang but instead times out. The web server and the web client will both have timeouts so that connections are not maintained indefinitely in the absence of data transfer. You can either avoid the timeouts by transferring some data (eg. the printing of dots which you've already found) or better yet you could restructure your code so that it runs in the background on the server and the client polls to determine when it has finished. The latter is generally accepted to be the better solution because it doesn't clog up the server with long-lived connections doing precious little.

There is of course a third option which is to optimise your code so that it produces results in a reasonably short time.


In reply to Re: CGI hangs unless print by hippo
in thread CGI hangs unless print by janedoh

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.