You should find a different way to read from plain files, for at least two reasons.
Multiplexing plain files is generally pointless because the operating system always reports them as "ready to read". That is, your select_read() event will fire immediately and constantly. You may as well do:
_start=>sub { $TXT = $poe_main_window->Scrolled('Text')->pack; $_[KERNEL]->yield('_GetInput'); }, _GetInput=>sub { if (defined(my $line = <$ifd>)) { print STDERR $line; $TXT->insert('end', "-$.- $line"); $poe_main_window->update; $_[KERNEL]->yield('_GetInput'); } },
Your example works on UNIX because that OS treats everything as a file. Sockets, plain files, pipes, terminals, etc. have their quirks, but deep down UNIX treats them equally.
As you're discovering, Windows isn't as nice. Even Perl's select() is limited to only working with sockets. This is why you can't get input notification for your plain file handle. The yield() based example above should be portable everywhere.
A third, bonus issue: You've been mixing unbuffered, multiplexed I/O with buffered reads. This is a classical problem that tends to end badly. For example, the file handle may report not-ready-to-read because the data you're looking for is in the input buffer. The yield() based example will avoid it.
In reply to Re^2: POE/Tk/Fileevent Strangeness
by rcaputo
in thread POE/Tk/Fileevent Strangeness
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |