Im curious if anyone has sucessfully used IO::Select on windows. I am trying to use it in some network code. I have been unable to get it to work. I thought I was doing something wrong since I havent used this module before. After messing with this all day today I got the idea to try it on my linux box, and it works fine. So now Im at a loss about what to do now. Basicly, on my win2k machine the loop immediately exits and the program closes. On my linux box, it loops through excepting keyboard data and quits on typing /quit.

If the module can not be made to work..... Is there another way I can get similar functionality??

Here is sniplet of the code.

sub MainLoop { my $self = shift; my $in = \*STDIN; my $net = $self->{'sock'}; my $sel = IO::Select->new($in); $sel->add($net); my @ready = (); DD: while(@ready = $sel->can_read) { foreach my $fh (@ready) { if ($fh == $in) { my $dat = <$fh>; chomp $dat; last DD if ($dat eq '/quit'); }elsif ($fh == $net) { } } } $self->logoff; close $self->{'sock'}; }

Thanks!
zzSPECTREz


In reply to IO::Select on Windows by zzspectrez

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.