- or download this
# FILE1 & FILE2 is a filehandle opened elsewhere. $read is a list of
# filehandles we are interested in reading
...
# (NOTE: $read=0 is very wrong)
vec($read, fileno(FILE1), 1) = 1; # Set the appropriate bit
vec($read, fileno(FILE2), 1) = 1; # And for another file...
- or download this
my $nfound = select($read, undef, undef, undef);
- or download this
# Does FILE1 have data waiting?
if (vec($read, fileno(FILE1), 1))
{
# ... do stuff ...
}
- or download this
#
# Simple multiplexing package
...
# ==
return 1;
- or download this
#
# TCP listener socket
...
# ==
return 1;
- or download this
package sillyTimer;
...
{
Multiplex::despatchevents()
}