SYN SYN
[p5sagit/p5-mst-13.2.git] / ext / IO / lib / IO / Select.pm
index f021a79..e84b54f 100644 (file)
@@ -7,10 +7,11 @@
 package IO::Select;
 
 use     strict;
+use warnings::register;
 use     vars qw($VERSION @ISA);
 require Exporter;
 
-$VERSION = "1.13";
+$VERSION = "1.14";
 
 @ISA = qw(Exporter); # This is only so we can do version checking
 
@@ -46,7 +47,9 @@ sub remove
 sub exists
 {
  my $vec = shift;
- $vec->[$vec->_fileno(shift) + FIRST_FD];
+ my $fno = $vec->_fileno(shift);
+ return undef unless defined $fno;
+ $vec->[$fno + FIRST_FD];
 }
 
 
@@ -127,9 +130,8 @@ sub has_exception
 
 sub has_error
 {
- require Carp;
- Carp::carp("Call to depreciated method 'has_error', use 'has_exception'")
-       if $^W;
+ warnings::warn("Call to depreciated method 'has_error', use 'has_exception'")
+       if warnings::enabled();
  goto &has_exception;
 }
 
@@ -298,9 +300,9 @@ Return an array of all registered handles.
 =item can_read ( [ TIMEOUT ] )
 
 Return an array of handles that are ready for reading. C<TIMEOUT> is
-the maximum amount of time to wait before returning an empty list. If
-C<TIMEOUT> is not given and any handles are registered then the call
-will block.
+the maximum amount of time to wait before returning an empty list, in
+seconds, possibly fractional. If C<TIMEOUT> is not given and any
+handles are registered then the call will block.
 
 =item can_write ( [ TIMEOUT ] )
 
@@ -345,7 +347,7 @@ listening for more connections on a listen socket
 
     $lsn = new IO::Socket::INET(Listen => 1, LocalPort => 8080);
     $sel = new IO::Select( $lsn );
-    
+
     while(@ready = $sel->can_read) {
         foreach $fh (@ready) {
             if($fh == $lsn) {