E
Ed W
Can't see what's wrong with this code... It's running under windows XP with
activestate perl 5.6.1 (which may well be part of the issue...).
The following code gives me an error:
Error in select: Bad file descriptor at io_select_test.pl line 11.
....However, it is pretty much straight out of the man pages.
The problem I am trying to solve is how to read from a bunch of sockets with
a blocking select, but also read from Stdin. I guess I could make my select
only block for 1/2 sec or so and then poll stdin, but there must be
something better than this? (in fact I seem to have some probs doing
non-blocking input from stdin under win32... Is this normal, does it work
for other people...)
#!perl -w
use strict;
use warnings;
use IO::Socket;
use IO::Select;
my $r = IO::Select->new(\*STDIN);
$|=1;
my ($rr) = IO::Select->select( $r )
or die "Error in select: $!";
print "Success";
activestate perl 5.6.1 (which may well be part of the issue...).
The following code gives me an error:
Error in select: Bad file descriptor at io_select_test.pl line 11.
....However, it is pretty much straight out of the man pages.
The problem I am trying to solve is how to read from a bunch of sockets with
a blocking select, but also read from Stdin. I guess I could make my select
only block for 1/2 sec or so and then poll stdin, but there must be
something better than this? (in fact I seem to have some probs doing
non-blocking input from stdin under win32... Is this normal, does it work
for other people...)
#!perl -w
use strict;
use warnings;
use IO::Socket;
use IO::Select;
my $r = IO::Select->new(\*STDIN);
$|=1;
my ($rr) = IO::Select->select( $r )
or die "Error in select: $!";
print "Success";