in reply to solution for fileevent on Win32 ???

This exact issue is discussed in the section "Polling Win32 Sockets" of the book "Mastering Perl/Tk: Graphical User Interfaces in Perl".

The basic idea is to set up a timer event to poll the socket.

As for other serialization formats, you might consider YAML or Storable.

  • Comment on Re: solution for fileevent on Win32 ???

Replies are listed 'Best First'.
Re^2: solution for fileevent on Win32 ???
by cta (Acolyte) on Jul 10, 2008 at 17:55 UTC
    thanks for your promptly responses.
    I did try to use the timer event but I don't see which method you can use to send data through the socket at the sender part.

    When you call the can_read method, can you get the event data or just the boolean value saying if there is any available data at the socket?
      A socket is just a file handle, so you can use syswrite or print.

      can_read (from IO::Select) only returns true or false. It is telling you that you will not block if you try to read from the file handle. You have to call read or sysread to get the data.