|We don't bite newbies here... much|
Non-blocking Reads from Pipe Filehandleby cbudin (Initiate)
|on Jun 13, 2007 at 19:21 UTC||Need Help??|
cbudin has asked for the
wisdom of the Perl Monks concerning the following question:
I'm trying to find a way to do a non-blocking read from a pipe filehandle, using ActivePerl 5.8.8 on Windows XP. Or, equivalently, a way to poll the pipe filehandle to see if there is data available to be read.
I've tried using select and IO::Select (select() and can_read() methods), to no avail (both seem to report nothing at all times). I've also tried to use fcntl to add the NON_BLOCKING flag to the filehandle, which gives back an error: "Your vendor has not defined Fcntl macro F_GETFL"
This seems like something that should be easy to do, but I've done a lot of searching and haven't come up with anything. I'm trying to do this as simply as possible, using as much plain vanilla Perl as I can, so I'd like to avoid having to use esoteric modules, threads, and the like, unless it's absolutely necessary.
To clarify, I would like to do something like this:
Thanks, in advance.