I checked back in after a couple of days to see how you are making out?

In my suggestions at this node, I am assuming that the autoflush would have the same effect as manually flushing after your child's print statement. Further assumed is that this file event notification does work and means that the pipe is ready for reading. If the pipe has any data in it, then all of the data for a single msg should be coming forthwith and certainly fast enough to have no impact on GUI performance.

If both of those are true, then my suggested blocking read until DONE seen should work well and you don't need your read() statement. There should never be any "garbage" before the start of the frame, e.g. "MSG". Stopping reading after seeing DONE should leave the input pipe completely empty. Things are more complicated if 2 msgs could be "back to back". But since they are only sent once per 10 seconds, I see no problem. Of concern with "back to back" messages would be timing issues with "re-enabling" the file even notification mechanism - not sure how that would work.

A good assumption for these pipes is that they are lossless. Probability of corruption is on the order of a memory RAM error (which nowadays is very low).


In reply to Re^5: Help requested to find the cause of an "uninitialized value" message by Marshall
in thread Help requested to find the cause of an "uninitialized value" message by andyok

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.