I need some way to check whether new data is available in the filehandle, without causing perl to wait until new data becomes available .... If anyone can think up a way around this, I'd really appreciate it!
Actually, that's exactly what Tk's "readable" fileEvent bit is supposed to be doing for you - it shouldn't get triggered until there's something to read.

It sounds to me as though you're trying to do something very similar to Chapter 22 of O'Reilly's Mastering Perl/TK. (Where would copyright violation be without the Chinese?) I suggest that you look at that code and see what, if any, of it can be adapted/coerced to your purposes.

Incidentally, I was going to mention the IO::Select package and how to use that (or the four argument form of the select builtin) to determine whether a filehandle has anything waiting to be read. However, Tk should be doing that internally already, so I'm not sure that gets you anything. (Still, I suppose it's worth trying at least once - there's an example of using it over here)


In reply to Re: Forking Win32 ... by fizbin
in thread Forking Win32 ... by owenjm

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.