in reply to Forking Win32 ...
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Forking Win32 ...
by owenjm (Initiate) on Feb 25, 2004 at 21:59 UTC | |
by YorHel (Initiate) on Jun 08, 2004 at 17:59 UTC |