Maybe you take STDOUT away too early (buffering and race condition) ?

Does this work?
my $pid; if ($pid = fork) { local $| = 1; # patch1 print qq~<response type="4" status="1">~; print qq~ </response>\n~; } elsif (defined $pid) { sleep 1; # patch2 close STDOUT; #exit; my $myba = mybaapp->new(); my $linkbase = $myba->mob2myba($url); $myba->sendinfo($smsfrurl); exit; } else { die "Major error: $!"; } #end fork
Update: Ahhh, brainglitch. Forget this!
Some more things to check: Did you update any modules recently? Does mybaapp use I/O (STDOUT)? What do you mean by ignored? Does the child still print something to STDOUT? Does it work if you do not close STDOUT? Did you use warnings;? Any warnings seen (e.g. print() on closed filehandle STDOUT at xxx line yyy.)? Any signals caught (SIGPIPE, SIGCHLD, etc.)? What does the main program (parent) do? Does it wait?

In reply to Re: fork question by Perlbotics
in thread fork question by jonnyfolk

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.