[EMAIL PROTECTED] wrote:
I have the following program that expresses a problem.  Can anyone tell me
what I'm doing wrong?  The program works perfectly under Unix, but on
WinNT/2K, it just hangs.  (Note, the processor goes nuts regardless if I
pass can_read a timeout or not).  Performing a perl -d on the app shows
that it never makes it into the foreach ($select->can_read never passes
back a handle).

I would appreciate some assistance.  I must be doing something totally
dumb.
Well, I guess so. :)  You can't use select on non-sockets on Win32.

#!perl
use strict;
use IO::Select;
use Data::Dumper;

my  $select = IO::Select->new( \*STDIN );

foreach my $fh ( $select->handles ) {
    print Data::Dumper->Dump( [ $fh ], [ qw($fh) ] );
}

for(;;) {
    #foreach my $fh ( $select->has_exception ) {
    foreach my $fh ( $select->can_read ) {
        if( $fh == \*STDIN ) {
            my  $input = <$fh>;
            exit if !defined $input;
            print "entered: $input";
        } else {
            exit;
        }
    }
}


--
  ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
 (_/   /  )    // //       DBE Collectibles   Mailto:dbe@;todbe.com
  / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to