in reply to socket reading...

BTW, don't you have to reload the $read vec after each select?

  p

Replies are listed 'Best First'.
Re: Re: socket reading...
by jdv79 (Sexton) on Jul 30, 2001 at 22:57 UTC
    please explain, if you will.
      from perlfunc select (second select entry :) )

            The usual idiom is:
      ($nfound,$timeleft) = select($rout=$rin, $wout=$win, $eout=$ein, $timeout);
      select overwrites $rout (your $read) to indicate what's available. So, except in the simplist case (1 fd, quit when done, like your example), it needs to be reset to the original on each call. You would need to if, for instance, you uncomment your vec(...FILE2) line.

        p

        Got it. How do I get what filehandle is ready for reading? I can see $nfound go high or low but if I had more than one sock open at one time it would be important to differentiate. Also, have you ever heard of GLOB(HEX_ADDY)? I cant find much on this reference type. I know that ref will return "glob" when called on such a ref. Does one just deref as if it was an array. I honestly forget how I got that value. I think it was from the select object in IO::SELECT. Just curious.