I have a base class that abstracts out a lot of file handle handling. It manages, FIFOs, sockets, STDIO, and reading of device drivers.
The root of the problem is that I need to use something like select() to tell me when there is data without blocking the entire process. Some data comes in character at a time whereas others come in line at a time. The problem is that select() doesn't play well with buffers, so I have to manage my own line discipline which uses \n as the data separator. The performance is terrible because I have to write for the worst case of the slow writers. I tried threads, and was underwhelmed. Too much memory, and initial results were not all that much better on the CPU usage. How does Event.pm compare with CPU utilization? Can I have it watch a filehandle that triggers when a line separator is received? I hope so, but the documentation sounds strangely familiar to a select() driving the heart of the system. Brian Michalk <http://www.awpi.com/michalk> Life is what you make of it ... never wish you had done something. Aviator, experimental aircraft builder, motorcyclist, SCUBA diver musician, home-brewer, entrepreneur and barely single.