Dear Monks,
I have a problem somewhere in my system that I can not figure out and am here to seek your help. I am running my perl script on an Apache server. The perl script invokes an external program and every second gets a response back from this external program telling it how many percent of the job has been completed among other statistical data. The script then pushes these data to the client machine running Firefox. It usually runs to completion most of the times but once in awhile, especially on a long running job, it just died in the middle of the runs but no error message is displayed on the client machine's window. The external program no longer existed when I type in ps -aux. I looked thru the Apache error_log in /etc/httpd/logs but found nothing in there. If I run the external program manually, everything is fine so the problem is not with the external program. Any help would be appreciated.
Attached is part of my code but the problem might not be with the code though.
Thanks in advance for your help.
print "Content-type: multipart/x-mixed-replace;"; print "boundary=magicalboundarystring\n\n"; print "--magicalboundarystring\n"; $com = "./myapp 5000"; open PIPE, "$com |"; while ($data = <PIPE>) { my ($read, $write, $update, $complete) = split(/::/, $data); print "Content-type: text/html\n\n"; print "Percent completed: $complete\n"; print "Write Time: $write\n"; print "Read Time: $read\n"; print '</body>'; print '</html>'; print "\n--magicalboundarystring\n"; } close(PIPE);

20070822 Janitored by Corion: Put code into code tags, as per Writeup Formatting Tips


In reply to Perl Script Server Push Died while running 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.