That's quite a lot of stuff in the "Win32 LIMITATIONS" section in that module's POD. ;)
But that is the nature of the beast. In Win32, select() only works on sockets, so use those instead of pipes. Tk::fileevent() also doesn't work, so setup a Tk::repeat() callback to invoke your read_socket() function at suitable intervals when $^O eq 'MSWin32' (in Unix context, stick with fileevent though, it's more efficient). read_socket() just calls select() on the socket, and if there's data it goes and does a non-blocking sysread() and dumps that stuff into a buffer (don't forget to check for errors and handle EWOULDBLOCK). You parse the buffer for network-portable EOL sequence (\015\012) and every time you get a whole line of data, you do whatever you need with it.
It's kind of hairy, and much more complex than what could be done in a pure Unix environment, but at least it works. Other methods may not work so well...
If you don't already have it, I hightly recommend the book "Network Programming with Perl" (by Lincoln Stein), it explains this stuff very well, and touches on limitations of Win32 and how to get around them. It also has lots of example code, including a multiplexing server, should you need that...
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.