K
Kenny McCormack
How do you do the equivalent of the following (abbreviated) C in Perl:
while (1) {
select(maxfd,&iofds,0,0,0);
if (FD_ISSET(fd1,&iofds))
... copy data from fd1 to fd2;
if (FD_ISSET(fd2,&iofds))
... copy data from fd2 to fd1;
}
(with, of course, all the appropriate error checking and so on...)
I'm comfortable with this idiom in C, but all I have to go on for Perl is
"man perlfunc" and the "Programming Perl" book. Both contain about the
same information, which is pretty good about how to build up the bits and
call the function, but contain nothing about how to unpack the result.
Can anyone help me with this?
while (1) {
select(maxfd,&iofds,0,0,0);
if (FD_ISSET(fd1,&iofds))
... copy data from fd1 to fd2;
if (FD_ISSET(fd2,&iofds))
... copy data from fd2 to fd1;
}
(with, of course, all the appropriate error checking and so on...)
I'm comfortable with this idiom in C, but all I have to go on for Perl is
"man perlfunc" and the "Programming Perl" book. Both contain about the
same information, which is pretty good about how to build up the bits and
call the function, but contain nothing about how to unpack the result.
Can anyone help me with this?